Bug 1188871: P2. Call DrainComplete should an error occurs while draining. r=snorp
authorJean-Yves Avenard <jyavenard@mozilla.com>
Thu, 13 Aug 2015 08:25:23 +1000
changeset 257747 cef6a397f50b4c92d2f021c0549f674c80a49cde
parent 257746 914e5f9795c9b8a0ec8ffd4e6546f95336ece704
child 257748 8fa8ea614226b42f447e38576dfe1eef7f89f685
push id29226
push userryanvm@gmail.com
push dateFri, 14 Aug 2015 13:01:14 +0000
treeherdermozilla-central@1b2402247429 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs1188871
milestone43.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 1188871: P2. Call DrainComplete should an error occurs while draining. r=snorp 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
@@ -388,16 +388,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) {