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 297867 188a6e9a86a0ec390cb3e22e617ae900c3118c71
parent 297866 e4f18dacf879ddce2043f9dca77af3d39c968f23
child 297868 b48f790070bbda0f28f2ad6a10f5f8f1fcf065f8
push idunknown
push userunknown
push dateunknown
reviewersjya
bugs1208349
milestone44.0a1
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;
   }