From edda0a3356b5ff11557e20bfa3f71c7d42207104 Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Thu, 10 Mar 2016 15:04:23 +1100 Subject: [PATCH] Bug 1254858: P8. Change default preferences value if prefs don't exist. r=kentuckyfriedtakahe When running gtest, none of the prefs actually exist, so we end up having most PDMs disabled. MozReview-Commit-ID: GNjhXtjKpGC --HG-- extra : rebase_source : 3e5a931dd49c798cff9792e3a1c4ff2e5afc4a83 --- dom/media/fmp4/MP4Decoder.cpp | 2 +- dom/media/platforms/PDMFactory.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dom/media/fmp4/MP4Decoder.cpp b/dom/media/fmp4/MP4Decoder.cpp index 2e41f4fff81b..126045d46506 100644 --- a/dom/media/fmp4/MP4Decoder.cpp +++ b/dom/media/fmp4/MP4Decoder.cpp @@ -180,7 +180,7 @@ MP4Decoder::CanHandleMediaType(const nsAString& aContentType) bool MP4Decoder::IsEnabled() { - return Preferences::GetBool("media.mp4.enabled"); + return Preferences::GetBool("media.mp4.enabled", true); } // sTestH264ExtraData represents the content of the avcC atom found in diff --git a/dom/media/platforms/PDMFactory.cpp b/dom/media/platforms/PDMFactory.cpp index 0cd11110ae4e..055c51725b97 100644 --- a/dom/media/platforms/PDMFactory.cpp +++ b/dom/media/platforms/PDMFactory.cpp @@ -82,10 +82,10 @@ PDMFactory::Init() alreadyInitialized = true; Preferences::AddBoolVarCache(&sUseBlankDecoder, - "media.use-blank-decoder"); + "media.use-blank-decoder", false); #ifdef MOZ_GONK_MEDIACODEC Preferences::AddBoolVarCache(&sGonkDecoderEnabled, - "media.gonk.enabled", false); + "media.gonk.enabled", true); #endif #ifdef MOZ_WIDGET_ANDROID Preferences::AddBoolVarCache(&sAndroidMCDecoderEnabled, @@ -95,18 +95,18 @@ PDMFactory::Init() #endif Preferences::AddBoolVarCache(&sGMPDecoderEnabled, - "media.gmp.decoder.enabled", false); + "media.gmp.decoder.enabled", true); #ifdef MOZ_FFMPEG Preferences::AddBoolVarCache(&sFFmpegDecoderEnabled, - "media.ffmpeg.enabled", false); + "media.ffmpeg.enabled", true); #endif #ifdef MOZ_FFVPX Preferences::AddBoolVarCache(&sFFVPXDecoderEnabled, - "media.ffvpx.enabled", false); + "media.ffvpx.enabled", true); #endif #ifdef XP_WIN Preferences::AddBoolVarCache(&sWMFDecoderEnabled, - "media.wmf.enabled", false); + "media.wmf.enabled", true); #endif Preferences::AddBoolVarCache(&sEnableFuzzingWrapper,