Bug 1056408 - Flush local task queues in AppleDecoderModule. r=cpearce
authorRalph Giles <giles@mozilla.com>
Wed, 20 Aug 2014 16:38:00 -0700
changeset 200739 36ed12777929c5fdbdae8bb5c5e59d9a1e36698a
parent 200738 9c45a39f76a21732d72f0ac370673adb6a3fe604
child 200740 69471d6c631a716ba07c8b65846e23451ed570c4
push id27353
push useremorley@mozilla.com
push dateThu, 21 Aug 2014 12:33:28 +0000
treeherdermozilla-central@479ec85d9e6f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1056408
milestone34.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 1056408 - Flush local task queues in AppleDecoderModule. r=cpearce We could still have data pending submission on the local task queue which would be submitted after we were supposed to have flushed.
content/media/fmp4/apple/AppleATDecoder.cpp
content/media/fmp4/apple/AppleVTDecoder.cpp
--- a/content/media/fmp4/apple/AppleATDecoder.cpp
+++ b/content/media/fmp4/apple/AppleATDecoder.cpp
@@ -124,16 +124,17 @@ AppleATDecoder::Input(mp4_demuxer::MP4Sa
 
   return NS_OK;
 }
 
 nsresult
 AppleATDecoder::Flush()
 {
   LOG("Flushing AudioToolbox AAC decoder");
+  mTaskQueue->Flush();
   OSStatus rv = AudioConverterReset(mConverter);
   if (rv) {
     LOG("Error %d resetting AudioConverter", rv);
     return NS_ERROR_FAILURE;
   }
   return NS_OK;
 }
 
--- a/content/media/fmp4/apple/AppleVTDecoder.cpp
+++ b/content/media/fmp4/apple/AppleVTDecoder.cpp
@@ -106,16 +106,17 @@ AppleVTDecoder::Input(mp4_demuxer::MP4Sa
           &AppleVTDecoder::SubmitFrame,
           nsAutoPtr<mp4_demuxer::MP4Sample>(aSample)));
   return NS_OK;
 }
 
 nsresult
 AppleVTDecoder::Flush()
 {
+  mTaskQueue->Flush();
   nsresult rv = WaitForAsynchronousFrames();
   if (NS_FAILED(rv)) {
     LOG("AppleVTDecoder::Drain failed waiting for platform decoder.");
   }
   mReorderQueue.Clear();
   return rv;
 }