Fix input buffer flushing for PS encoder.

Bug 177604812
Test: see PS/SBR encoder

Change-Id: I3152bd7db5e039ecc54885e5b58c1cf6cb598b28
This commit is contained in:
Fraunhofer IIS FDK 2020-04-17 15:10:17 +02:00 committed by Ray Essick
parent bd021e7fb4
commit 4fbc97cc47
1 changed files with 6 additions and 5 deletions

View File

@ -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;