Bug 1208349 - Ensure we query PDM whether it supports MP4 before assuming it supports MP4. r=jya,a=kentuckyfriedtakahe
authorChris Pearce <cpearce@mozilla.com>
Fri, 25 Sep 2015 23:17:50 +1200
changeset 296149 68577583acedfc6c366cdf82c99444e08327fa36
parent 296148 f1b8f0d4fca2e01913abacd5fbedef3fdebc2959
child 296150 fedd673e16c3414eb0a0beafec5b0e061f49915d
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya, kentuckyfriedtakahe
bugs1208349
milestone43.0a2
Bug 1208349 - Ensure we query PDM whether it supports MP4 before assuming it supports MP4. r=jya,a=kentuckyfriedtakahe
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;
   }