Bug 897895 - Correct the pcm offset when encoding audio source with two channels. r=roc

This commit is contained in:
Shelly Lin 2013-08-14 11:04:55 +08:00
Родитель b9d171dfa6
Коммит b9274bb4a5
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -272,7 +272,7 @@ OpusTrackEncoder::GetEncodedTrack(nsTArray<uint8_t>* aOutput,
if (!chunk.IsNull()) { if (!chunk.IsNull()) {
// Append the interleaved data to the end of pcm buffer. // Append the interleaved data to the end of pcm buffer.
InterleaveTrackData(chunk, frameToCopy, mChannels, InterleaveTrackData(chunk, frameToCopy, mChannels,
pcm.Elements() + frameCopied); pcm.Elements() + frameCopied * mChannels);
} else { } else {
for (int i = 0; i < frameToCopy * mChannels; i++) { for (int i = 0; i < frameToCopy * mChannels; i++) {
pcm.AppendElement(0); pcm.AppendElement(0);