aboutsummaryrefslogtreecommitdiffstats
path: root/libAACdec/src
diff options
context:
space:
mode:
authorFraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de>2020-04-17 15:08:34 +0200
committerJean-Michel Trivi <jmtrivi@google.com>2021-01-14 15:41:58 -0800
commitaf0c91e7b88ebe1a2b9a2dc272a7ba4faa92f478 (patch)
treeba8f9b626b052ab24fb1d010ecc6f9494f589f3d /libAACdec/src
parent67cae74f74bce961e0812c1743c64df96a3396b7 (diff)
downloadfdk-aac-af0c91e7b88ebe1a2b9a2dc272a7ba4faa92f478.tar.gz
fdk-aac-af0c91e7b88ebe1a2b9a2dc272a7ba4faa92f478.tar.bz2
fdk-aac-af0c91e7b88ebe1a2b9a2dc272a7ba4faa92f478.zip
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
Diffstat (limited to 'libAACdec/src')
-rw-r--r--libAACdec/src/aacdecoder_lib.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/libAACdec/src/aacdecoder_lib.cpp b/libAACdec/src/aacdecoder_lib.cpp
index 6fb7bf1..47d204b 100644
--- a/libAACdec/src/aacdecoder_lib.cpp
+++ b/libAACdec/src/aacdecoder_lib.cpp
@@ -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;
}