commit 0109abd08387a67efbda9a4d02c44f1c177efb8c Author: Ralph Giles giles@mozilla.com Date: Fri Jan 31 13:50:45 2014 -0800
Bug 966311 - Calculate frame size for stereo wave. r=doublec, a=sledru
We were assuming 8-bit WAVE files were mono-only, but this is not necessarily the case. --- content/media/wave/WaveReader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/content/media/wave/WaveReader.cpp b/content/media/wave/WaveReader.cpp index 28aec46..ce71ea6 100644 --- a/content/media/wave/WaveReader.cpp +++ b/content/media/wave/WaveReader.cpp @@ -424,7 +424,7 @@ WaveReader::LoadFormatChunk(uint32_t aChunkSize) // Make sure metadata is fairly sane. The rate check is fairly arbitrary, // but the channels check is intentionally limited to mono or stereo // because that's what the audio backend currently supports. - unsigned int actualFrameSize = sampleFormat == 8 ? 1 : 2 * channels; + unsigned int actualFrameSize = (sampleFormat == 8 ? 1 : 2) * channels; if (rate < 100 || rate > 96000 || channels < 1 || channels > MAX_CHANNELS || (frameSize != 1 && frameSize != 2 && frameSize != 4) ||