Bug 1214469 - Ensure gmp-clearkey accounts for mNumInputTasks when flushing. r=gerald, a=sylvestre
authorChris Pearce <cpearce@mozilla.com>
Wed, 14 Oct 2015 19:42:24 +1300
changeset 289546 b09a797a251b
parent 289545 a27cc6aa6e0d
child 289547 ebafbc7c1a87
push id5178
push usercbook@mozilla.com
push date2015-10-15 09:17 +0000
treeherdermozilla-beta@b09a797a251b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald, sylvestre
bugs1214469
milestone42.0
Bug 1214469 - Ensure gmp-clearkey accounts for mNumInputTasks when flushing. r=gerald, a=sylvestre
media/gmp-clearkey/0.1/VideoDecoder.cpp
--- a/media/gmp-clearkey/0.1/VideoDecoder.cpp
+++ b/media/gmp-clearkey/0.1/VideoDecoder.cpp
@@ -136,27 +136,27 @@ private:
 
 void
 VideoDecoder::DecodeTask(GMPVideoEncodedFrame* aInput)
 {
   CK_LOGD("VideoDecoder::DecodeTask");
   AutoReleaseVideoFrame ensureFrameReleased(aInput);
   HRESULT hr;
 
-  if (mIsFlushing) {
-    CK_LOGD("VideoDecoder::DecodeTask rejecting frame: flushing.");
-    return;
-  }
-
   {
     AutoLock lock(mMutex);
     mNumInputTasks--;
     assert(mNumInputTasks >= 0);
   }
 
+  if (mIsFlushing) {
+    CK_LOGD("VideoDecoder::DecodeTask rejecting frame: flushing.");
+    return;
+  }
+
   if (!aInput || !mHostAPI || !mDecoder) {
     CK_LOGE("Decode job not set up correctly!");
     return;
   }
 
   const uint8_t* inBuffer = aInput->Buffer();
   if (!inBuffer) {
     CK_LOGE("No buffer for encoded frame!\n");