Bug 1301518 - Support mapping family 255 when playing an Opus file, for use with the Web Audio API. r=jya a=ritu
authorPaul Adenot <paul@paul.cx>
Fri, 09 Sep 2016 17:10:09 +0200
changeset 348101 2f0c6a3164536083c2ba2e3c0f55b993f27f2085
parent 348100 56321464405dc99b8a9b68c0fc60e9d628f75bf5
child 348102 86446c9b103bff79ac2cccd2d90b401deba4bf66
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya, ritu
bugs1301518
milestone50.0a2
Bug 1301518 - Support mapping family 255 when playing an Opus file, for use with the Web Audio API. r=jya a=ritu MozReview-Commit-ID: AaTCp16m6ks
dom/media/ogg/OpusParser.cpp
--- a/dom/media/ogg/OpusParser.cpp
+++ b/dom/media/ogg/OpusParser.cpp
@@ -81,18 +81,19 @@ bool OpusParser::DecodeHeader(unsigned c
         OPUS_LOG(LogLevel::Debug, ("Invalid Opus file: too many channels (%d) for"
                            " mapping family 0.", mChannels));
         return false;
       }
       mStreams = 1;
       mCoupledStreams = mChannels - 1;
       mMappingTable[0] = 0;
       mMappingTable[1] = 1;
-    } else if (mChannelMapping == 1) {
-      // Currently only up to 8 channels are defined for mapping family 1
+    } else if (mChannelMapping == 1 || mChannelMapping == 255) {
+      // Currently only up to 8 channels are defined for mapping family 1 and we
+      // only supports only up to 8 channels for mapping family 255.
       if (mChannels>8) {
         OPUS_LOG(LogLevel::Debug, ("Invalid Opus file: too many channels (%d) for"
                            " mapping family 1.", mChannels));
         return false;
       }
       if (aLength>static_cast<unsigned>(20+mChannels)) {
         mStreams = aData[19];
         mCoupledStreams = aData[20];