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

Commit 7532ae7f authored by Andreas Huber's avatar Andreas Huber Committed by Android Git Automerger
Browse files

am 46956b06: Merge "DO NOT MERGE: Fix a race condition when playing an...

am 46956b06: Merge "DO NOT MERGE: Fix a race condition when playing an audio-only stream and seeking before starting." into honeycomb-mr1

* commit '46956b06':
  DO NOT MERGE: Fix a race condition when playing an audio-only stream and seeking before starting.
parents 1d8b5a5e 46956b06
Loading
Loading
Loading
Loading
+5 −12
Original line number Original line Diff line number Diff line
@@ -750,8 +750,6 @@ status_t AwesomePlayer::play_l() {
    mFlags |= PLAYING;
    mFlags |= PLAYING;
    mFlags |= FIRST_FRAME;
    mFlags |= FIRST_FRAME;


    bool deferredAudioSeek = false;

    if (mDecryptHandle != NULL) {
    if (mDecryptHandle != NULL) {
        int64_t position;
        int64_t position;
        getPosition(&position);
        getPosition(&position);
@@ -767,10 +765,11 @@ status_t AwesomePlayer::play_l() {


                mTimeSource = mAudioPlayer;
                mTimeSource = mAudioPlayer;


                deferredAudioSeek = true;
                // If there was a seek request before we ever started,

                // honor the request now.
                mWatchForAudioSeekComplete = false;
                // Make sure to do this before starting the audio player
                mWatchForAudioEOS = true;
                // to avoid a race condition.
                seekAudioIfNecessary_l();
            }
            }
        }
        }


@@ -808,12 +807,6 @@ status_t AwesomePlayer::play_l() {
        }
        }
    }
    }


    if (deferredAudioSeek) {
        // If there was a seek request while we were paused
        // and we're just starting up again, honor the request now.
        seekAudioIfNecessary_l();
    }

    if (mFlags & AT_EOS) {
    if (mFlags & AT_EOS) {
        // Legacy behaviour, if a stream finishes playing and then
        // Legacy behaviour, if a stream finishes playing and then
        // is started again, we play from the start...
        // is started again, we play from the start...