diff options
author | Fraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de> | 2018-12-20 15:52:47 +0100 |
---|---|---|
committer | Jean-Michel Trivi <jmtrivi@google.com> | 2020-01-22 11:11:56 -0800 |
commit | 3ce7751a440cafe41ff2eefb105b03096fbe122c (patch) | |
tree | a62c4b53e6bfd56c4a9df7b86cb2acc217185b5c /libDRCdec/src/FDK_drcDecLib.cpp | |
parent | cee316ab3ebde92047b5e76d15c00768b92cb890 (diff) | |
download | fdk-aac-3ce7751a440cafe41ff2eefb105b03096fbe122c.tar.gz fdk-aac-3ce7751a440cafe41ff2eefb105b03096fbe122c.tar.bz2 fdk-aac-3ce7751a440cafe41ff2eefb105b03096fbe122c.zip |
Perform sanity check on DRC sets and improve the selection process
Bug: 137282770
Bug: 141883493
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: Ie8e17c82653cb0d9adcdb10ec3f4875b6207ac6f
Diffstat (limited to 'libDRCdec/src/FDK_drcDecLib.cpp')
-rw-r--r-- | libDRCdec/src/FDK_drcDecLib.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libDRCdec/src/FDK_drcDecLib.cpp b/libDRCdec/src/FDK_drcDecLib.cpp index 4f8ebc7..e43279f 100644 --- a/libDRCdec/src/FDK_drcDecLib.cpp +++ b/libDRCdec/src/FDK_drcDecLib.cpp @@ -145,6 +145,10 @@ struct s_drc_decoder { SEL_PROC_OUTPUT selProcOutput; } DRC_DECODER; +static int _getGainStatus(HANDLE_UNI_DRC_GAIN hUniDrcGain) { + return hUniDrcGain->status; +} + static int isResetNeeded(HANDLE_DRC_DECODER hDrcDec, const SEL_PROC_OUTPUT oldSelProcOutput) { int i, resetNeeded = 0; @@ -729,7 +733,9 @@ FDK_drcDec_ReadUniDrcGain(HANDLE_DRC_DECODER hDrcDec, &(hDrcDec->uniDrcGain)); if (dErr) return DRC_DEC_NOT_OK; - hDrcDec->status = DRC_DEC_NEW_GAIN_PAYLOAD; + if (_getGainStatus(&(hDrcDec->uniDrcGain))) { + hDrcDec->status = DRC_DEC_NEW_GAIN_PAYLOAD; + } return DRC_DEC_OK; } @@ -751,7 +757,9 @@ FDK_drcDec_ReadUniDrc(HANDLE_DRC_DECODER hDrcDec, startSelectionProcess(hDrcDec); if (dErr) return DRC_DEC_NOT_OK; - hDrcDec->status = DRC_DEC_NEW_GAIN_PAYLOAD; + if (_getGainStatus(&(hDrcDec->uniDrcGain))) { + hDrcDec->status = DRC_DEC_NEW_GAIN_PAYLOAD; + } return DRC_DEC_OK; } |