Bug 1242465 - when defined USING_MOZFFVPX use by default videoCodec in FindAVCodec. r?jya draft
authorBogdan Postelnicu <bogdan.postelnicu@softvision.ro>
Tue, 26 Jan 2016 11:24:59 +0200
changeset 325675 927149e377d6a785fa8cf355b68c6c1ec2d0d613
parent 324949 c2256ee8ae9a8ee0bf7ab49a8b1924720d846cc7
child 513494 acaa2d2716f44aaeac870841a2ef59310fa2c88f
push id10029
push userbmo:bogdan.postelnicu@softvision.ro
push dateTue, 26 Jan 2016 09:27:52 +0000
reviewersjya
bugs1242465
milestone46.0a1
Bug 1242465 - when defined USING_MOZFFVPX use by default videoCodec in FindAVCodec. r?jya
dom/media/platforms/ffmpeg/FFmpegDecoderModule.h
--- a/dom/media/platforms/ffmpeg/FFmpegDecoderModule.h
+++ b/dom/media/platforms/ffmpeg/FFmpegDecoderModule.h
@@ -54,27 +54,30 @@ public:
     RefPtr<MediaDataDecoder> decoder =
       new FFmpegAudioDecoder<V>(mLib, aAudioTaskQueue, aCallback, aConfig);
     return decoder.forget();
 #endif
   }
 
   bool SupportsMimeType(const nsACString& aMimeType) const override
   {
+    AVCodecID videoCodec = FFmpegVideoDecoder<V>::GetCodecId(aMimeType);
 #ifdef USING_MOZFFVPX
-    AVCodecID audioCodec = AV_CODEC_ID_NONE;
+    if (videoCodec == AV_CODEC_ID_NONE) {
+        return false;
+    }
+    return !!FFmpegDataDecoder<V>::FindAVCodec(mLib, videoCodec);
 #else
     AVCodecID audioCodec = FFmpegAudioDecoder<V>::GetCodecId(aMimeType);
-#endif
-    AVCodecID videoCodec = FFmpegVideoDecoder<V>::GetCodecId(aMimeType);
     if (audioCodec == AV_CODEC_ID_NONE && videoCodec == AV_CODEC_ID_NONE) {
       return false;
     }
     AVCodecID codec = audioCodec != AV_CODEC_ID_NONE ? audioCodec : videoCodec;
     return !!FFmpegDataDecoder<V>::FindAVCodec(mLib, codec);
+#endif
   }
 
   ConversionRequired
   DecoderNeedsConversion(const TrackInfo& aConfig) const override
   {
     if (aConfig.IsVideo() &&
         (aConfig.mMimeType.EqualsLiteral("video/avc") ||
          aConfig.mMimeType.EqualsLiteral("video/mp4"))) {