Bug 1208349 - Ensure we query PDM whether it supports MP4 before assuming it supports MP4. r=jya
authorChris Pearce <cpearce@mozilla.com>
Fri, 25 Sep 2015 23:17:50 +1200
changeset 264372 c2dec99392dfa494274a927bd037a21be8fa130b
parent 264371 1ffb54341546384a44219bed5badb95afb1fa33b
child 264373 ebeeda14c3fa0f24240e487bcd8fa7c119f99038
push id65613
push usercpearce@mozilla.com
push dateFri, 25 Sep 2015 11:19:42 +0000
treeherdermozilla-inbound@c2dec99392df [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1208349
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 1208349 - Ensure we query PDM whether it supports MP4 before assuming it supports MP4. r=jya
dom/media/fmp4/MP4Decoder.cpp
--- a/dom/media/fmp4/MP4Decoder.cpp
+++ b/dom/media/fmp4/MP4Decoder.cpp
@@ -270,17 +270,17 @@ CreateTestH264Decoder(layers::LayersBack
   aConfig.mImage = nsIntRect(0, 0, 64, 64);
   aConfig.mExtraData = new MediaByteBuffer();
   aConfig.mExtraData->AppendElements(sTestH264ExtraData,
                                      MOZ_ARRAY_LENGTH(sTestH264ExtraData));
 
   PlatformDecoderModule::Init();
 
   nsRefPtr<PlatformDecoderModule> platform = PlatformDecoderModule::Create();
-  if (!platform) {
+  if (!platform || !platform->SupportsMimeType(NS_LITERAL_CSTRING("video/mp4"))) {
     return nullptr;
   }
 
   nsRefPtr<MediaDataDecoder> decoder(
     platform->CreateDecoder(aConfig, nullptr, nullptr, aBackend, nullptr));
   if (!decoder) {
     return nullptr;
   }
@@ -326,17 +326,17 @@ MP4Decoder::CanCreateH264Decoder()
 
 #ifdef XP_WIN
 static already_AddRefed<MediaDataDecoder>
 CreateTestAACDecoder(AudioInfo& aConfig)
 {
   PlatformDecoderModule::Init();
 
   nsRefPtr<PlatformDecoderModule> platform = PlatformDecoderModule::Create();
-  if (!platform) {
+  if (!platform || !platform->SupportsMimeType(NS_LITERAL_CSTRING("audio/mp4a-latm"))) {
     return nullptr;
   }
 
   nsRefPtr<MediaDataDecoder> decoder(
     platform->CreateDecoder(aConfig, nullptr, nullptr));
   if (!decoder) {
     return nullptr;
   }