Bug 1315567: P2. Expose opus codec as being available in mp4. r=gerald,a=gchang
authorJean-Yves Avenard <jyavenard@mozilla.com>
Mon, 07 Nov 2016 11:08:32 +1100
changeset 356515 c9ab0a2b4edfcc61731208fc07a13a229a863dbc
parent 356514 eb7e5e61642b52c69c6b188ed87b4241fe086cf2
child 356516 b2d49247a29d5b04470ac0d3c1b152d63e1656d1
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald, gchang
bugs1315567
milestone51.0a2
Bug 1315567: P2. Expose opus codec as being available in mp4. r=gerald,a=gchang Backport from Firefox 52 to Firefox 51. MozReview-Commit-ID: GU8me70Igsq
dom/media/fmp4/MP4Decoder.cpp
--- a/dom/media/fmp4/MP4Decoder.cpp
+++ b/dom/media/fmp4/MP4Decoder.cpp
@@ -124,16 +124,20 @@ MP4Decoder::CanHandleMediaType(const nsA
       if (IsAACCodecString(codec)) {
         codecMimes.AppendElement(NS_LITERAL_CSTRING("audio/mp4a-latm"));
         continue;
       }
       if (codec.EqualsLiteral("mp3")) {
         codecMimes.AppendElement(NS_LITERAL_CSTRING("audio/mpeg"));
         continue;
       }
+      if (codec.EqualsLiteral("opus")) {
+        codecMimes.AppendElement(NS_LITERAL_CSTRING("audio/opus"));
+        continue;
+      }
       // Note: Only accept H.264 in a video content type, not in an audio
       // content type.
       if (IsWhitelistedH264Codec(codec) && isMP4Video) {
         codecMimes.AppendElement(NS_LITERAL_CSTRING("video/avc"));
         continue;
       }
       // Some unsupported codec.
       return false;