Bug 1207214 - Assert decoder attaches EOS flag to final output buffer. r=sotaro
authorJohn Lin <jolin@mozilla.com>
Fri, 16 Oct 2015 00:45:00 -0400
changeset 303506 8207861574e514c327996adf030795f9e34370d7
parent 303446 a5d54cef3b23d237ca1f8db3874ebdaf9c2d2638
child 303507 69e01c8ae9d01c174c43082de66646588f8b9ead
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssotaro
bugs1207214
milestone44.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 1207214 - Assert decoder attaches EOS flag to final output buffer. r=sotaro
dom/media/platforms/gonk/GonkMediaDataDecoder.cpp
--- a/dom/media/platforms/gonk/GonkMediaDataDecoder.cpp
+++ b/dom/media/platforms/gonk/GonkMediaDataDecoder.cpp
@@ -202,21 +202,23 @@ GonkDecoderManager::ProcessToDo(bool aEn
   while (mWaitOutput.Length() > 0) {
     RefPtr<MediaData> output;
     int64_t offset = mWaitOutput.ElementAt(0);
     rv = Output(offset, output);
     if (rv == NS_OK) {
       mWaitOutput.RemoveElementAt(0);
       mDecodeCallback->Output(output);
     } else if (rv == NS_ERROR_ABORT) {
-      GMDD_LOG("eos output");
-      mWaitOutput.RemoveElementAt(0);
+      // EOS
       MOZ_ASSERT(mQueuedSamples.IsEmpty());
-      MOZ_ASSERT(mWaitOutput.IsEmpty());
-      // EOS
+      mWaitOutput.RemoveElementAt(0);
+      // Sometimes the decoder attaches EOS flag to the final output buffer
+      // instead of emits EOS by itself, hence the 2nd condition.
+      MOZ_ASSERT(mWaitOutput.IsEmpty() ||
+                 (mWaitOutput.Length() == 1 && output.get()));
       if (output) {
         mDecodeCallback->Output(output);
       }
       mDecodeCallback->DrainComplete();
       return;
     } else if (rv == NS_ERROR_NOT_AVAILABLE) {
       break;
     } else {