Bug 1277508: P1. Don't attempt to demux new samples while we're currently draining. r=kamidphish
authorJean-Yves Avenard <jyavenard@mozilla.com>
Thu, 02 Jun 2016 20:54:33 +1000
changeset 339320 9cef6a01859a4b863063f79c4994c7283a3321aa
parent 339319 f75d7afd686e2af034d60e321c032b313e3ba440
child 339321 8b89d98ce322f0c68538db7837cd7eb749d1ed1c
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskamidphish
bugs1277508
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1277508: P1. Don't attempt to demux new samples while we're currently draining. r=kamidphish We should only attempt to demux new samples once all pending decoded frames have been returned. Otherwise, the next demuxing attempt once a resolution change has been detected will reset the state and drop all decoded frames. MozReview-Commit-ID: 2coKQA8lZ8c
dom/media/MediaFormatReader.cpp
--- a/dom/media/MediaFormatReader.cpp
+++ b/dom/media/MediaFormatReader.cpp
@@ -745,17 +745,17 @@ bool
 MediaFormatReader::NeedInput(DecoderData& aDecoder)
 {
   // We try to keep a few more compressed samples input than decoded samples
   // have been output, provided the state machine has requested we send it a
   // decoded sample. To account for H.264 streams which may require a longer
   // run of input than we input, decoders fire an "input exhausted" callback,
   // which overrides our "few more samples" threshold.
   return
-    !aDecoder.mDraining &&
+    !(aDecoder.mDraining || aDecoder.mDrainComplete) &&
     !aDecoder.HasFatalError() &&
     aDecoder.mDecodingRequested &&
     !aDecoder.mDemuxRequest.Exists() &&
     !aDecoder.HasInternalSeekPending() &&
     aDecoder.mOutput.Length() <= aDecoder.mDecodeAhead &&
     (aDecoder.mInputExhausted || !aDecoder.mQueuedSamples.IsEmpty() ||
      aDecoder.mTimeThreshold.isSome() ||
      aDecoder.mNumSamplesInput - aDecoder.mNumSamplesOutput <= aDecoder.mDecodeAhead);