Bug 1188871: P1. Don't drain decoders when an error is encountered. r=cpearce a=ritu
authorJean-Yves Avenard <jyavenard@mozilla.com>
Thu, 13 Aug 2015 08:21:34 +1000
changeset 289088 f0d454030d3d631533dc132516f701f0fc96beda
parent 289087 f3d195cea5f455b07905d9b0788f50b03ab7635e
child 289089 d710215ba3d5f56c1e12d9725be2304ee2901dbc
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce, ritu
bugs1188871, 1173657
milestone42.0a2
Bug 1188871: P1. Don't drain decoders when an error is encountered. r=cpearce a=ritu This is a partial revert of bug 1173657 (commit 80f9da7f0806). Not all decoders will properly handle draining when they have encountered an error and will never call DrainComplete(). The Gonk and Android decoder do not. So we just get around this.
dom/media/MediaFormatReader.cpp
--- a/dom/media/MediaFormatReader.cpp
+++ b/dom/media/MediaFormatReader.cpp
@@ -743,17 +743,16 @@ MediaFormatReader::NotifyDrainComplete(T
 
 void
 MediaFormatReader::NotifyError(TrackType aTrack)
 {
   MOZ_ASSERT(OnTaskQueue());
   LOGV("%s Decoding error", TrackTypeToStr(aTrack));
   auto& decoder = GetDecoderData(aTrack);
   decoder.mError = true;
-  decoder.mNeedDraining = true;
   ScheduleUpdate(aTrack);
 }
 
 void
 MediaFormatReader::NotifyWaitingForData(TrackType aTrack)
 {
   MOZ_ASSERT(OnTaskQueue());
   auto& decoder = GetDecoderData(aTrack);
@@ -1077,17 +1076,17 @@ MediaFormatReader::Update(TrackType aTra
       decoder.mDraining = false;
       if (decoder.mError) {
         LOG("Decoding Error");
         decoder.RejectPromise(DECODE_ERROR, __func__);
         return;
       } else if (decoder.mDemuxEOS) {
         decoder.RejectPromise(END_OF_STREAM, __func__);
       }
-    } else if (decoder.mError && !decoder.mDecoder) {
+    } else if (decoder.mError) {
       decoder.RejectPromise(DECODE_ERROR, __func__);
       return;
     } else if (decoder.mWaitingForData) {
       LOG("Waiting For Data");
       decoder.RejectPromise(WAITING_FOR_DATA, __func__);
       return;
     }
   }