Backed out changeset eab2e401c60f (bug 1397141)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Wed, 13 Sep 2017 09:25:28 +0200
changeset 663807 f6eabbf84e5ecf6f800cf4e69d5951e2b25d3106
parent 663806 d1579ffe85624b4f6b0cfa3673427a538a794b7e
child 663808 d347d7618b0f9f3449274ad62d58a8cd4e381c77
push id79536
push userbmo:rchien@mozilla.com
push dateWed, 13 Sep 2017 12:07:56 +0000
bugs1397141
milestone57.0a1
backs outeab2e401c60fccb6e5904f101775bc298c7135ce
Backed out changeset eab2e401c60f (bug 1397141)
dom/media/MediaFormatReader.cpp
--- a/dom/media/MediaFormatReader.cpp
+++ b/dom/media/MediaFormatReader.cpp
@@ -714,25 +714,28 @@ 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,
@@ -766,20 +769,17 @@ MediaFormatReader::DecoderFactory::DoCre
     default:
       break;
   }
 
   if (aData.mDecoder) {
     return NS_OK;
   }
 
-  if (NS_FAILED(result)) {
-    ownerData.mDescription = result.Description();
-  }
-
+  ownerData.mDescription = decoderCreatingError;
   return result;
 }
 
 void
 MediaFormatReader::DecoderFactory::DoInitDecoder(Data& aData)
 {
   auto& ownerData = aData.mOwnerData;