Bug 1171311: P8. Ensure we will always decode available data. r=cpearce
authorJean-Yves Avenard <jyavenard@mozilla.com>
Fri, 12 Jun 2015 09:26:58 +1000
changeset 266630 29a86559487287f3f4b93430ffa31c3116ea7479
parent 266629 0628a6c3be527a5f1793e40c00668978670eebcd
child 266631 2328d14a175c0081b1ce30c70244e8f7d07bcf2e
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-esr52@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1171311
milestone41.0a1
Bug 1171311: P8. Ensure we will always decode available data. r=cpearce
dom/media/MediaFormatReader.cpp
--- a/dom/media/MediaFormatReader.cpp
+++ b/dom/media/MediaFormatReader.cpp
@@ -845,16 +845,19 @@ MediaFormatReader::DecodeDemuxedSamples(
     decoder.mDecoder->Input(samples);
   }
   decoder.mNumSamplesInput += decoder.mQueuedSamples.Length();
   decoder.mSizeOfQueue += decoder.mQueuedSamples.Length();
   if (aTrack == TrackInfo::kVideoTrack) {
     aA.mParsed += decoder.mQueuedSamples.Length();
   }
   decoder.mQueuedSamples.Clear();
+
+  // We have serviced the decoder's request for more data.
+  decoder.mInputExhausted = false;
 }
 
 void
 MediaFormatReader::Update(TrackType aTrack)
 {
   MOZ_ASSERT(OnTaskQueue());
 
   if (mShutdown) {
@@ -923,17 +926,16 @@ MediaFormatReader::Update(TrackType aTra
   }
 
   if (!NeedInput(decoder)) {
     LOGV("No need for additional input");
     return;
   }
 
   needInput = true;
-  decoder.mInputExhausted = false;
 
   LOGV("Update(%s) ni=%d no=%d ie=%d, in:%d out:%d qs=%d",
        TrackTypeToStr(aTrack), needInput, needOutput, decoder.mInputExhausted,
        decoder.mNumSamplesInput, decoder.mNumSamplesOutput,
        size_t(decoder.mSizeOfQueue));
 
   // Demux samples if we don't have some.
   RequestDemuxSamples(aTrack);