Bug 1303673 - Part 9: Make some GMP errors non fatal. r=cpearce, a=gchang
authorJean-Yves Avenard <jyavenard@mozilla.com>
Tue, 20 Sep 2016 16:56:58 +1000
changeset 355726 c8e5c40a96a414d862b357ba1638d2809acace29
parent 355725 f7e04b094809146b98d45f2d0158d62772381480
child 355727 67474923ff42310f656669f2f8161ed705789d0a
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce, gchang
bugs1303673
milestone51.0a2
Bug 1303673 - Part 9: Make some GMP errors non fatal. r=cpearce, a=gchang MozReview-Commit-ID: LMWQtJElle7
dom/media/platforms/agnostic/gmp/GMPAudioDecoder.cpp
dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp
--- a/dom/media/platforms/agnostic/gmp/GMPAudioDecoder.cpp
+++ b/dom/media/platforms/agnostic/gmp/GMPAudioDecoder.cpp
@@ -118,18 +118,20 @@ AudioCallbackAdapter::ResetComplete()
   mMustRecaptureAudioPosition = true;
   mCallback->FlushComplete();
 }
 
 void
 AudioCallbackAdapter::Error(GMPErr aErr)
 {
   MOZ_ASSERT(IsOnGMPThread());
-  mCallback->Error(
-    MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR, RESULT_DETAIL("GMPErr:%x", aErr)));
+  mCallback->Error(MediaResult(aErr == GMPDecodeErr
+                               ? NS_ERROR_DOM_MEDIA_DECODE_ERR
+                               : NS_ERROR_DOM_MEDIA_FATAL_ERR,
+                               RESULT_DETAIL("GMPErr:%x", aErr)));
 }
 
 void
 AudioCallbackAdapter::Terminated()
 {
   mCallback->Error(MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
                                RESULT_DETAIL("Audio GMP decoder terminated.")));
 }
--- a/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp
+++ b/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp
@@ -90,18 +90,20 @@ VideoCallbackAdapter::ResetComplete()
   MOZ_ASSERT(IsOnGMPThread());
   mCallback->FlushComplete();
 }
 
 void
 VideoCallbackAdapter::Error(GMPErr aErr)
 {
   MOZ_ASSERT(IsOnGMPThread());
-  mCallback->Error(
-    MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR, RESULT_DETAIL("GMPErr:%x", aErr)));
+  mCallback->Error(MediaResult(aErr == GMPDecodeErr
+                               ? NS_ERROR_DOM_MEDIA_DECODE_ERR
+                               : NS_ERROR_DOM_MEDIA_FATAL_ERR,
+                               RESULT_DETAIL("GMPErr:%x", aErr)));
 }
 
 void
 VideoCallbackAdapter::Terminated()
 {
   // Note that this *may* be called from the proxy thread also.
   mCallback->Error(MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
                                RESULT_DETAIL("Video GMP decoder terminated.")));