aboutsummaryrefslogtreecommitdiffstats
path: root/libAACenc/src/aacenc_lib.cpp
diff options
context:
space:
mode:
authorFraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de>2020-04-17 15:09:22 +0200
committerRay Essick <essick@google.com>2021-02-14 12:23:20 -0800
commitbd021e7fb414744d47d48af1996b08ee2dc24a9c (patch)
treecfb9f86f072e19fa818be67c2e372485000f5906 /libAACenc/src/aacenc_lib.cpp
parent0c2c08aef6849fdec71cae4d769c6cd3dd86303d (diff)
downloadfdk-aac-bd021e7fb414744d47d48af1996b08ee2dc24a9c.tar.gz
fdk-aac-bd021e7fb414744d47d48af1996b08ee2dc24a9c.tar.bz2
fdk-aac-bd021e7fb414744d47d48af1996b08ee2dc24a9c.zip
Fix wrong input buffer feed for PS encoder at less input samples than framesize.
Bug 177604812 Test: see PS/SBR encoder Change-Id: I08a20209bcb83784fda5c14584b6e99c65672545
Diffstat (limited to 'libAACenc/src/aacenc_lib.cpp')
-rw-r--r--libAACenc/src/aacenc_lib.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libAACenc/src/aacenc_lib.cpp b/libAACenc/src/aacenc_lib.cpp
index b0d0454..3bfdfe8 100644
--- a/libAACenc/src/aacenc_lib.cpp
+++ b/libAACenc/src/aacenc_lib.cpp
@@ -1784,8 +1784,8 @@ AACENC_ERROR aacEncEncode(const HANDLE_AACENCODER hAacEncoder,
hAacEncoder->nSamplesRead));
INT_PCM *pIn =
hAacEncoder->inputBuffer +
- (hAacEncoder->inputBufferOffset + hAacEncoder->nSamplesRead) /
- hAacEncoder->aacConfig.nChannels;
+ hAacEncoder->inputBufferOffset / hAacEncoder->aacConfig.nChannels +
+ hAacEncoder->nSamplesRead / hAacEncoder->extParam.nChannels;
newSamples -=
(newSamples %
hAacEncoder->extParam