aboutsummaryrefslogtreecommitdiffstats
path: root/libAACenc
diff options
context:
space:
mode:
authorFraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de>2020-04-17 15:10:17 +0200
committerJean-Michel Trivi <jmtrivi@google.com>2021-01-14 17:30:22 -0800
commit91ec65f7c82b202df559384e0844780bb9d80318 (patch)
tree7ca936a06902975ed776457aa562159ca6d67684 /libAACenc
parenta7c36cc207495967b4b31fbb86162860146281c6 (diff)
downloadfdk-aac-91ec65f7c82b202df559384e0844780bb9d80318.tar.gz
fdk-aac-91ec65f7c82b202df559384e0844780bb9d80318.tar.bz2
fdk-aac-91ec65f7c82b202df559384e0844780bb9d80318.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 19546fc..caa62c5 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;