mirror of
https://github.com/mstorsjo/fdk-aac.git
synced 2025-06-05 22:39:13 +02:00
Solve issue regarding config changes between Loudness-only vs. Loudness+DRC.
Fix config changes from Loudness+DRC to Loudness-only configurations by clearing the DRC configuration Bug: 176246647 Test: atest android.media.cts.DecoderTestAacFormat android.media.cts.DecoderTestXheAac android.media.cts.DecoderTestAacDrc Change-Id: I7afef848308478c29a82b13f24ba8c2a9760fd45
This commit is contained in:
committed by
Jean-Michel Trivi
parent
67cae74f74
commit
af0c91e7b8
@ -441,12 +441,23 @@ static INT aacDecoder_UniDrcCallback(void *handle, HANDLE_FDK_BITSTREAM hBs,
|
||||
TRANSPORTDEC_ERROR errTp;
|
||||
HANDLE_AACDECODER hAacDecoder = (HANDLE_AACDECODER)handle;
|
||||
DRC_DEC_CODEC_MODE drcDecCodecMode = DRC_DEC_CODEC_MODE_UNDEFINED;
|
||||
UCHAR dummyBuffer[4] = {0};
|
||||
FDK_BITSTREAM dummyBs;
|
||||
HANDLE_FDK_BITSTREAM hReadBs;
|
||||
|
||||
if (subStreamIndex != 0) {
|
||||
return TRANSPORTDEC_OK;
|
||||
}
|
||||
|
||||
else if (aot == AOT_USAC) {
|
||||
if (hBs == NULL) {
|
||||
/* use dummy zero payload to clear memory */
|
||||
hReadBs = &dummyBs;
|
||||
FDKinitBitStream(hReadBs, dummyBuffer, 4, 24);
|
||||
} else {
|
||||
hReadBs = hBs;
|
||||
}
|
||||
|
||||
if (aot == AOT_USAC) {
|
||||
drcDecCodecMode = DRC_DEC_MPEG_D_USAC;
|
||||
}
|
||||
|
||||
@ -455,10 +466,10 @@ static INT aacDecoder_UniDrcCallback(void *handle, HANDLE_FDK_BITSTREAM hBs,
|
||||
|
||||
if (payloadType == 0) /* uniDrcConfig */
|
||||
{
|
||||
err = FDK_drcDec_ReadUniDrcConfig(hAacDecoder->hUniDrcDecoder, hBs);
|
||||
err = FDK_drcDec_ReadUniDrcConfig(hAacDecoder->hUniDrcDecoder, hReadBs);
|
||||
} else /* loudnessInfoSet */
|
||||
{
|
||||
err = FDK_drcDec_ReadLoudnessInfoSet(hAacDecoder->hUniDrcDecoder, hBs);
|
||||
err = FDK_drcDec_ReadLoudnessInfoSet(hAacDecoder->hUniDrcDecoder, hReadBs);
|
||||
hAacDecoder->loudnessInfoSetPosition[1] = payloadStart;
|
||||
hAacDecoder->loudnessInfoSetPosition[2] = fullPayloadLength;
|
||||
}
|
||||
|
Reference in New Issue
Block a user