Bug 1397141 - part7 : update error description in MFR. r=jya
☠☠ backed out by f6eabbf84e5e ☠ ☠
authorAlastor Wu <alwu@mozilla.com>
Wed, 13 Sep 2017 15:06:14 +0800
changeset 429999 eab2e401c60fccb6e5904f101775bc298c7135ce
parent 429998 c78c096d0be97477324fe5b0e94b61094ec5d5d0
child 430000 f6f5863e50a8b8725bb6af0eb2cca44c561c7a6e
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1397141
milestone57.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 1397141 - part7 : update error description in MFR. r=jya MozReview-Commit-ID: 5QPdFCMesi5
dom/media/MediaFormatReader.cpp
--- a/dom/media/MediaFormatReader.cpp
+++ b/dom/media/MediaFormatReader.cpp
@@ -714,28 +714,25 @@ MediaFormatReader::DecoderFactory::RunSt
   }
 }
 
 MediaResult
 MediaFormatReader::DecoderFactory::DoCreateDecoder(Data& aData)
 {
   auto& ownerData = aData.mOwnerData;
 
-  auto decoderCreatingError = "error creating audio decoder";
-  MediaResult result =
-    MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR, decoderCreatingError);
-
   if (!mOwner->mPlatform) {
     mOwner->mPlatform = new PDMFactory();
     if (mOwner->IsEncrypted()) {
       MOZ_ASSERT(mOwner->mCDMProxy);
       mOwner->mPlatform->SetCDMProxy(mOwner->mCDMProxy);
     }
   }
 
+  MediaResult result(NS_OK);
   switch (aData.mTrack) {
     case TrackInfo::kAudioTrack: {
       aData.mDecoder = mOwner->mPlatform->CreateDecoder({
         ownerData.mInfo
         ? *ownerData.mInfo->GetAsAudioInfo()
         : *ownerData.mOriginalInfo->GetAsAudioInfo(),
         ownerData.mTaskQueue,
         mOwner->mCrashHelper,
@@ -769,17 +766,20 @@ MediaFormatReader::DecoderFactory::DoCre
     default:
       break;
   }
 
   if (aData.mDecoder) {
     return NS_OK;
   }
 
-  ownerData.mDescription = decoderCreatingError;
+  if (NS_FAILED(result)) {
+    ownerData.mDescription = result.Description();
+  }
+
   return result;
 }
 
 void
 MediaFormatReader::DecoderFactory::DoInitDecoder(Data& aData)
 {
   auto& ownerData = aData.mOwnerData;