Unify audio element loop abort criterion in ER syntax

Bug: 112891548
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: Iea56cf804cfb9d396810124c718fc91bdff68392
(cherry picked from commit f2bc07da2e)
This commit is contained in:
Fraunhofer IIS FDK 2018-08-15 14:33:56 +02:00 committed by android-build-team Robot
parent ce97e7d55e
commit 0e5db9fee9
1 changed files with 4 additions and 7 deletions

View File

@ -2047,17 +2047,12 @@ CAacDecoder_Init(HANDLE_AACDECODER self, const CSAudioSpecificConfig *asc,
if (self->flags[streamIndex] & (AC_RSV603DA | AC_USAC)) { if (self->flags[streamIndex] & (AC_RSV603DA | AC_USAC)) {
_numElements = (int)asc->m_sc.m_usacConfig.m_usacNumElements; _numElements = (int)asc->m_sc.m_usacConfig.m_usacNumElements;
} }
if (self->flags[streamIndex] & (AC_ER | AC_LD | AC_ELD)) {
_numElements = (asc->m_channelConfiguration == 7)
? 8
: asc->m_channelConfiguration;
}
for (int _el = 0; _el < _numElements; _el++) { for (int _el = 0; _el < _numElements; _el++) {
int el_channels = 0; int el_channels = 0;
int el = elementOffset + _el; int el = elementOffset + _el;
if (self->flags[streamIndex] & if (self->flags[streamIndex] &
(AC_ELD | AC_RSV603DA | AC_USAC | AC_RSVD50)) { (AC_ER | AC_LD | AC_ELD | AC_RSV603DA | AC_USAC | AC_RSVD50)) {
if (ch >= ascChannels) { if (ch >= ascChannels) {
break; break;
} }
@ -2107,7 +2102,9 @@ CAacDecoder_Init(HANDLE_AACDECODER self, const CSAudioSpecificConfig *asc,
(SPECTRAL_PTR)&self->workBufferCore2[ch * 1024]; (SPECTRAL_PTR)&self->workBufferCore2[ch * 1024];
if (el_channels == 2) { if (el_channels == 2) {
FDK_ASSERT(ch < (8) - 1); if (ch >= (8) - 1) {
return AAC_DEC_UNSUPPORTED_CHANNELCONFIG;
}
self->pAacDecoderChannelInfo[ch + 1]->pComData = self->pAacDecoderChannelInfo[ch + 1]->pComData =
self->pAacDecoderChannelInfo[ch]->pComData; self->pAacDecoderChannelInfo[ch]->pComData;
self->pAacDecoderChannelInfo[ch + 1]->pComStaticData = self->pAacDecoderChannelInfo[ch + 1]->pComStaticData =