aboutsummaryrefslogtreecommitdiffstats
path: root/libMpegTPDec/src
diff options
context:
space:
mode:
authorFraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de>2020-04-09 17:58:17 +0200
committerJean-Michel Trivi <jmtrivi@google.com>2020-12-28 09:21:16 -0800
commit5eb9ed1b1fe94e8bf94bba4aa305b61db19b48c5 (patch)
tree54d9ad0b41c5d7eecfb60c9c4b2fa53027f1116e /libMpegTPDec/src
parentd6a7375bfa25ebcdd47900e5f32958c6c8deb57f (diff)
downloadfdk-aac-5eb9ed1b1fe94e8bf94bba4aa305b61db19b48c5.tar.gz
fdk-aac-5eb9ed1b1fe94e8bf94bba4aa305b61db19b48c5.tar.bz2
fdk-aac-5eb9ed1b1fe94e8bf94bba4aa305b61db19b48c5.zip
Check number of core channels and SAC decoder input channels to avoid a channel mismatch.
Bug: 176246647 Test: atest android.media.cts.DecoderTestAacFormat android.media.cts.DecoderTestXheAac android.media.cts.DecoderTestAacDrc Change-Id: Ib8b6973e9c29e13b8ef33d7736be2b977928face
Diffstat (limited to 'libMpegTPDec/src')
-rw-r--r--libMpegTPDec/src/tpdec_asc.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/libMpegTPDec/src/tpdec_asc.cpp b/libMpegTPDec/src/tpdec_asc.cpp
index ffe85c1..5a89a4d 100644
--- a/libMpegTPDec/src/tpdec_asc.cpp
+++ b/libMpegTPDec/src/tpdec_asc.cpp
@@ -1415,7 +1415,7 @@ static TRANSPORTDEC_ERROR EldSpecificConfig_Parse(CSAudioSpecificConfig *asc,
cb->cbSscData, hBs, asc->m_aot,
asc->m_samplingFrequency << esc->m_sbrSamplingRate,
asc->m_samplesPerFrame << esc->m_sbrSamplingRate,
- 1, /* stereoConfigIndex */
+ asc->m_channelConfiguration, 1, /* stereoConfigIndex */
-1, /* nTimeSlots: read from bitstream */
eldExtLen, asc->configMode, &asc->SacConfigChanged);
if (ErrorStatus != TRANSPORTDEC_OK) {
@@ -1827,6 +1827,8 @@ static TRANSPORTDEC_ERROR UsacRsv60DecoderConfig_Parse(
/* Mps212Config() ISO/IEC FDIS 23003-3 */
if (cb->cbSsc(cb->cbSscData, hBs, asc->m_aot,
asc->m_extensionSamplingFrequency, samplesPerFrame,
+ 1, /* only downmix channels (residual channels are
+ not counted) */
usc->element[i].m_stereoConfigIndex,
usc->m_coreSbrFrameLengthIndex,
0, /* don't know the length */
@@ -2221,7 +2223,7 @@ TRANSPORTDEC_ERROR AudioSpecificConfig_Parse(
case AOT_MPEGS:
if (cb->cbSsc != NULL) {
if (cb->cbSsc(cb->cbSscData, bs, self->m_aot, self->m_samplingFrequency,
- self->m_samplesPerFrame, 1,
+ self->m_samplesPerFrame, self->m_channelConfiguration, 1,
-1, /* nTimeSlots: read from bitstream */
0, /* don't know the length */
self->configMode, &self->SacConfigChanged)) {
@@ -2419,6 +2421,8 @@ static TRANSPORTDEC_ERROR Drm_xHEAACDecoderConfig(
cb->cbSscData, hBs,
AOT_DRM_USAC, /* syntax differs from MPEG Mps212Config() */
asc->m_extensionSamplingFrequency, samplesPerFrame,
+ 1, /* only downmix channels (residual channels are not
+ counted) */
usc->element[elemIdx].m_stereoConfigIndex,
usc->m_coreSbrFrameLengthIndex, 0, /* don't know the length */
asc->configMode, &asc->SacConfigChanged);