aboutsummaryrefslogtreecommitdiffstats
path: root/libAACenc
diff options
context:
space:
mode:
authorFraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de>2020-04-17 15:10:17 +0200
committerRay Essick <essick@google.com>2021-02-14 12:23:29 -0800
commit4fbc97cc479704a5e12d2d3c0d2b782cf21595a3 (patch)
tree2a97def70e30af245fc9132ec5869346bd770f55 /libAACenc
parentbd021e7fb414744d47d48af1996b08ee2dc24a9c (diff)
downloadfdk-aac-4fbc97cc479704a5e12d2d3c0d2b782cf21595a3.tar.gz
fdk-aac-4fbc97cc479704a5e12d2d3c0d2b782cf21595a3.tar.bz2
fdk-aac-4fbc97cc479704a5e12d2d3c0d2b782cf21595a3.zip
Fix input buffer flushing for PS encoder.
Bug 177604812 Test: see PS/SBR encoder Change-Id: I3152bd7db5e039ecc54885e5b58c1cf6cb598b28
Diffstat (limited to 'libAACenc')
-rw-r--r--libAACenc/src/aacenc_lib.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/libAACenc/src/aacenc_lib.cpp b/libAACenc/src/aacenc_lib.cpp
index 3bfdfe8..0217641 100644
--- a/libAACenc/src/aacenc_lib.cpp
+++ b/libAACenc/src/aacenc_lib.cpp
@@ -1827,12 +1827,13 @@ AACENC_ERROR aacEncEncode(const HANDLE_AACENCODER hAacEncoder,
/* clear out until end-of-buffer */
if (nZeros) {
+ INT_PCM *pIn =
+ hAacEncoder->inputBuffer +
+ hAacEncoder->inputBufferOffset /
+ hAacEncoder->aacConfig.nChannels +
+ hAacEncoder->nSamplesRead / hAacEncoder->extParam.nChannels;
for (i = 0; i < (int)hAacEncoder->extParam.nChannels; i++) {
- FDKmemclear(hAacEncoder->inputBuffer +
- i * hAacEncoder->inputBufferSizePerChannel +
- (hAacEncoder->inputBufferOffset +
- hAacEncoder->nSamplesRead) /
- hAacEncoder->extParam.nChannels,
+ FDKmemclear(pIn + i * hAacEncoder->inputBufferSizePerChannel,
sizeof(INT_PCM) * nZeros);
}
hAacEncoder->nZerosAppended += nZeros;