Bug 1208349 - Ensure we query PDM whether it supports MP4 before assuming it supports MP4. r=jya
☠☠ backed out by aa0bd5b49975 ☠ ☠
authorChris Pearce <cpearce@mozilla.com>
Fri, 25 Sep 2015 18:38:22 +1200
changeset 264333 188a6e9a86a0ec390cb3e22e617ae900c3118c71
parent 264332 e4f18dacf879ddce2043f9dca77af3d39c968f23
child 264334 b48f790070bbda0f28f2ad6a10f5f8f1fcf065f8
push id65604
push usercpearce@mozilla.com
push dateFri, 25 Sep 2015 06:38:42 +0000
treeherdermozilla-inbound@188a6e9a86a0 [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/mp4"))) {
     return nullptr;
   }
 
   nsRefPtr<MediaDataDecoder> decoder(
     platform->CreateDecoder(aConfig, nullptr, nullptr));
   if (!decoder) {
     return nullptr;
   }