diff options
author | Jeroen Vreeken <jeroen@vreeken.net> | 2019-07-11 16:36:22 +0200 |
---|---|---|
committer | Jeroen Vreeken <jeroen@vreeken.net> | 2019-07-11 16:36:22 +0200 |
commit | e02b04663a430a8d84503b31270b8a6bcfe7a5c7 (patch) | |
tree | cd580c19b66ce62987ece8df5d2ba7384c329502 /dom/media/webm/WebMDecoder.cpp | |
parent | 85cc631748c1c6c755d7532733959d1f2321e3ec (diff) | |
download | aura-central-e02b04663a430a8d84503b31270b8a6bcfe7a5c7.tar.gz |
Make matroska mime type checking more consistent.
Diffstat (limited to 'dom/media/webm/WebMDecoder.cpp')
-rw-r--r-- | dom/media/webm/WebMDecoder.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/dom/media/webm/WebMDecoder.cpp b/dom/media/webm/WebMDecoder.cpp index 37e1e4a33..5cb943742 100644 --- a/dom/media/webm/WebMDecoder.cpp +++ b/dom/media/webm/WebMDecoder.cpp @@ -41,8 +41,11 @@ WebMDecoder::CanHandleMediaType(const nsACString& aMIMETypeExcludingCodecs, } const bool isWebMAudio = aMIMETypeExcludingCodecs.EqualsASCII("audio/webm"); - const bool isWebMVideo = aMIMETypeExcludingCodecs.EqualsASCII("video/webm") || aMIMETypeExcludingCodecs.EqualsASCII("video/x-matroska") ; - if (!isWebMAudio && !isWebMVideo) { + const bool isWebMVideo = aMIMETypeExcludingCodecs.EqualsASCII("video/webm"); + const bool isMatroskaAudio = aMIMETypeExcludingCodecs.EqualsASCII("audio/x-matroska") ; + const bool isMatroskaVideo = aMIMETypeExcludingCodecs.EqualsASCII("video/x-matroska") ; + + if (!isWebMAudio && !isWebMVideo && !isMatroskaAudio && !isMatroskaVideo) { return false; } @@ -63,7 +66,7 @@ WebMDecoder::CanHandleMediaType(const nsACString& aMIMETypeExcludingCodecs, } // Note: Only accept VP8/VP9 in a video content type, not in an audio // content type. - if (isWebMVideo && + if ((isWebMVideo || isMatroskaVideo) && (codec.EqualsLiteral("vp8") || codec.EqualsLiteral("vp8.0") || codec.EqualsLiteral("vp9") || codec.EqualsLiteral("vp9.0"))) { |