Bug 1504944 - Only re-order channels for opus mapping 1. r=padenot

For channel mapping 0 (which is always mono or sterero), the mapping is identical to the SMPTE one, so can copy the mapping as-is.

Differential Revision: https://phabricator.services.mozilla.com/D11000

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jean-Yves Avenard 2018-11-06 18:11:41 +00:00
Родитель be738fcaba
Коммит ff9dbafc2c
1 изменённых файлов: 3 добавлений и 3 удалений

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

@ -154,13 +154,13 @@ OpusDataDecoder::DecodeHeader(const unsigned char* aData, size_t aLength)
AutoTArray<uint8_t, 8> map;
map.SetLength(channels);
if (vorbisLayout.MappingTable(smpteLayout, &map)) {
if (mOpusParser->mChannelMapping == 1 &&
vorbisLayout.MappingTable(smpteLayout, &map)) {
for (int i = 0; i < channels; i++) {
mMappingTable[i] = mOpusParser->mMappingTable[map[i]];
}
} else {
// Should never get here as vorbis layout is always convertible to SMPTE
// default layout.
// Use Opus set channel mapping and return channels as-is.
PodCopy(mMappingTable.Elements(), mOpusParser->mMappingTable, channels);
}
} else {