Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 50872331 authored by Sidipotu Ashok's avatar Sidipotu Ashok Committed by Steve Kondik
Browse files

frameworks/av: Fix for video playback failure in browser

- Issue: After camping the Signal to 3G network, open the browser
and go to www.youtube.com and play any video. Video playback is
failing after trying to load the video for few seconds. Browser is
coming back to video's list.

- Cause: At the beginning of playback, as there was a seek request
pending, seek is done before starting the AudioPlayer. After
AudioSource seeking, AudioPlayer start is called with OMX in PAUSED
state, causing assert check fail for OMX state.

- Fix: Call AudioSource start before calling AudioPlayer start, so that
OMX moves to EXECUTING state.

(Fix is ported from ICS I4e746bf0b5167d4998fd900bbce3966a2dc1273d)
CRs-Fixed: 395384

Change-Id: Id4f7e8658ba96b28533d11d34d4622ea6106615d
parent d7d74e73
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -1873,6 +1873,9 @@ void AwesomePlayer::finishSeekIfNecessary(int64_t videoTimeUs) {
void AwesomePlayer::onVideoEvent() {
    ATRACE_CALL();
    Mutex::Autolock autoLock(mLock);
#ifdef QCOM_HARDWARE
    int mAudioSourcePaused = false;
#endif
    if (!mVideoEventPending) {
        // The event has been cancelled in reset_l() but had already
        // been scheduled for execution at that time.
@@ -1927,6 +1930,9 @@ void AwesomePlayer::onVideoEvent() {
                modifyFlags(AUDIO_RUNNING, CLEAR);
            }
            mAudioSource->pause();
#ifdef QCOM_HARDWARE
            mAudioSourcePaused = true;
#endif
        }
    }

@@ -1968,6 +1974,12 @@ void AwesomePlayer::onVideoEvent() {
                }
                finishSeekIfNecessary(-1);

#ifdef QCOM_HARDWARE
                if (mAudioSourcePaused) {
                    mAudioSource->start();
                    mAudioSourcePaused = false;
                }
#endif
                if (mAudioPlayer != NULL
                        && !(mFlags & (AUDIO_RUNNING | SEEK_PREVIEW))) {
                    startAudioPlayer_l();
@@ -2027,6 +2039,12 @@ void AwesomePlayer::onVideoEvent() {
    SeekType wasSeeking = mSeeking;
    finishSeekIfNecessary(timeUs);

#ifdef QCOM_HARDWARE
    if (mAudioSourcePaused) {
        mAudioSource->start();
        mAudioSourcePaused = false;
    }
#endif
    if (mAudioPlayer != NULL && !(mFlags & (AUDIO_RUNNING | SEEK_PREVIEW))) {
        status_t err = startAudioPlayer_l();
        if (err != OK) {