Bug 1188871: P2. Call DrainComplete should an error occurs while draining. r=snorp a=ritu
authorJean-Yves Avenard <jyavenard@mozilla.com>
Thu, 13 Aug 2015 08:25:23 +1000
changeset 289089 d710215ba3d5f56c1e12d9725be2304ee2901dbc
parent 289088 f0d454030d3d631533dc132516f701f0fc96beda
child 289090 41ef0f0e5d6de9f346a1e19c38e207d10446a8ae
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)
reviewerssnorp, ritu
bugs1188871
milestone42.0a2
Bug 1188871: P2. Call DrainComplete should an error occurs while draining. r=snorp a=ritu Part 1 prevented draining when an error occurred first. This handles the case where an error occurs during draining.
dom/media/platforms/android/AndroidDecoderModule.cpp
--- a/dom/media/platforms/android/AndroidDecoderModule.cpp
+++ b/dom/media/platforms/android/AndroidDecoderModule.cpp
@@ -376,16 +376,20 @@ nsresult MediaCodecDataDecoder::InitDeco
 }
 
 // This is in usec, so that's 10ms
 #define DECODER_TIMEOUT 10000
 
 #define HANDLE_DECODER_ERROR() \
   if (NS_FAILED(res)) { \
     NS_WARNING("exiting decoder loop due to exception"); \
+    if (mDraining) { \
+      ENVOKE_CALLBACK(DrainComplete); \
+      mDraining = false; \
+    } \
     ENVOKE_CALLBACK(Error); \
     break; \
   }
 
 nsresult MediaCodecDataDecoder::GetInputBuffer(JNIEnv* env, int index, jni::Object::LocalRef* buffer)
 {
   bool retried = false;
   while (!*buffer) {