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

Commit f4ba6193 authored by Robert Shih's avatar Robert Shih Committed by Android Git Automerger
Browse files

am a2981013: NuPlayer: fix av discontinuity race

* commit 'a2981013':
  NuPlayer: fix av discontinuity race
parents 37ae54ee a2981013
Loading
Loading
Loading
Loading
+8 −7
Original line number Original line Diff line number Diff line
@@ -1230,7 +1230,6 @@ status_t NuPlayer::feedDecoderInputData(bool audio, const sp<AMessage> &msg) {
                mTimeDiscontinuityPending =
                mTimeDiscontinuityPending =
                    mTimeDiscontinuityPending || timeChange;
                    mTimeDiscontinuityPending || timeChange;


                if (formatChange || timeChange) {
                if (mFlushingAudio == NONE && mFlushingVideo == NONE) {
                if (mFlushingAudio == NONE && mFlushingVideo == NONE) {
                    // And we'll resume scanning sources once we're done
                    // And we'll resume scanning sources once we're done
                    // flushing.
                    // flushing.
@@ -1239,6 +1238,8 @@ status_t NuPlayer::feedDecoderInputData(bool audio, const sp<AMessage> &msg) {
                                &NuPlayer::performScanSources));
                                &NuPlayer::performScanSources));
                }
                }


                if (formatChange || timeChange) {

                    sp<AMessage> newFormat = mSource->getFormat(audio);
                    sp<AMessage> newFormat = mSource->getFormat(audio);
                    sp<Decoder> &decoder = audio ? mAudioDecoder : mVideoDecoder;
                    sp<Decoder> &decoder = audio ? mAudioDecoder : mVideoDecoder;
                    if (formatChange && !decoder->supportsSeamlessFormatChange(newFormat)) {
                    if (formatChange && !decoder->supportsSeamlessFormatChange(newFormat)) {