Bug 1218577: Use only Blank PDM if enabled. r=kamidphish
authorJean-Yves Avenard <jyavenard@mozilla.com>
Tue, 27 Oct 2015 08:49:03 +1100
changeset 305280 8c07b084c0f8fb17885979c3322f5e15a1298bbe
parent 305279 1200b4f1676c5478504a67ee76e1470140b35aa2
child 305281 1d4c00dbf49a26cd3b5819fd7c9cce4a6a2c5b63
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskamidphish
bugs1218577
milestone44.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 1218577: Use only Blank PDM if enabled. r=kamidphish
dom/media/platforms/PDMFactory.cpp
--- a/dom/media/platforms/PDMFactory.cpp
+++ b/dom/media/platforms/PDMFactory.cpp
@@ -236,16 +236,25 @@ PDMFactory::SupportsMimeType(const nsACS
   return !!current;
 }
 
 void
 PDMFactory::CreatePDMs()
 {
   RefPtr<PlatformDecoderModule> m;
 
+  if (sUseBlankDecoder) {
+    m = CreateBlankDecoderModule();
+    StartupPDM(m);
+    // The Blank PDM SupportsMimeType reports true for all codecs; the creation
+    // of its decoder is infallible. As such it will be used for all media, we
+    // can stop creating more PDM from this point.
+    return;
+  }
+
   if (sGMPDecoderEnabled) {
     m = new GMPDecoderModule();
     StartupPDM(m);
   }
 #ifdef MOZ_WIDGET_ANDROID
   if(sAndroidMCDecoderPreferred && sAndroidMCDecoderEnabled) {
     m = new AndroidDecoderModule();
     StartupPDM(m);
@@ -277,21 +286,16 @@ PDMFactory::CreatePDMs()
   if(sAndroidMCDecoderEnabled){
     m = new AndroidDecoderModule();
     StartupPDM(m);
   }
 #endif
 
   m = new AgnosticDecoderModule();
   StartupPDM(m);
-
-  if (sUseBlankDecoder) {
-    m = CreateBlankDecoderModule();
-    StartupPDM(m);
-  }
 }
 
 bool
 PDMFactory::StartupPDM(PlatformDecoderModule* aPDM)
 {
   if (aPDM && NS_SUCCEEDED(aPDM->Startup())) {
     mCurrentPDMs.AppendElement(aPDM);
     return true;