Bug 1273310 - Simplify DecoderDoctor failure flags. r=gerald
authorRalph Giles <giles@mozilla.com>
Mon, 16 May 2016 15:53:17 -0700
changeset 297596 e80ac440424e03ff95b971553ed818d5161884a9
parent 297595 19a99223c7fca71cb1c16ff9f5c80ed5470629f9
child 297597 11116e24295830044db1a9ce7990f05f18a21ddb
push id30264
push userkwierso@gmail.com
push dateTue, 17 May 2016 20:52:53 +0000
treeherdermozilla-central@991f249a6ffa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald
bugs1273310
milestone49.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 1273310 - Simplify DecoderDoctor failure flags. r=gerald This is a bit easier to read. Currently there's no difference since Startup is only called once, but it's probably better future-proofing too, since the diagnostics should care more about the current state than whether there's every been a failure. Likewise reset the flags if the decoder is turned off by a preference change. MozReview-Commit-ID: 4zD7rkD6A3J
dom/media/platforms/PDMFactory.cpp
--- a/dom/media/platforms/PDMFactory.cpp
+++ b/dom/media/platforms/PDMFactory.cpp
@@ -250,33 +250,33 @@ PDMFactory::CreatePDMs()
      MediaPrefs::PDMAndroidMediaCodecEnabled()) {
     m = new AndroidDecoderModule();
     StartupPDM(m);
   }
 #endif
 #ifdef XP_WIN
   if (MediaPrefs::PDMWMFEnabled()) {
     m = new WMFDecoderModule();
-    if (!StartupPDM(m)) {
-      mWMFFailedToLoad = true;
-    }
+    mWMFFailedToLoad = !StartupPDM(m);
+  } else {
+    mWMFFailedToLoad = false;
   }
 #endif
 #ifdef MOZ_FFVPX
   if (MediaPrefs::PDMFFVPXEnabled()) {
     m = FFVPXRuntimeLinker::CreateDecoderModule();
     StartupPDM(m);
   }
 #endif
 #ifdef MOZ_FFMPEG
   if (MediaPrefs::PDMFFmpegEnabled()) {
     m = FFmpegRuntimeLinker::CreateDecoderModule();
-    if (!StartupPDM(m)) {
-      mFFmpegFailedToLoad = true;
-    }
+    mFFmpegFailedToLoad = !StartupPDM(m);
+  } else {
+    mFFmpegFailedToLoad = false;
   }
 #endif
 #ifdef MOZ_APPLEMEDIA
   m = new AppleDecoderModule();
   StartupPDM(m);
 #endif
 #ifdef MOZ_GONK_MEDIACODEC
   if (MediaPrefs::PDMGonkDecoderEnabled()) {
@@ -291,19 +291,19 @@ PDMFactory::CreatePDMs()
   }
 #endif
 
   m = new AgnosticDecoderModule();
   StartupPDM(m);
 
   if (MediaPrefs::PDMGMPEnabled()) {
     m = new GMPDecoderModule();
-    if (!StartupPDM(m)) {
-      mGMPPDMFailedToStartup = true;
-    }
+    mGMPPDMFailedToStartup = !StartupPDM(m);
+  } else {
+    mGMPPDMFailedToStartup = false;
   }
 }
 
 bool
 PDMFactory::StartupPDM(PlatformDecoderModule* aPDM)
 {
   if (aPDM && NS_SUCCEEDED(aPDM->Startup())) {
     mCurrentPDMs.AppendElement(aPDM);