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
committerJean-Michel Trivi <jmtrivi@google.com>2021-01-14 17:28:11 -0800
commita7c36cc207495967b4b31fbb86162860146281c6 (patch)
tree550d6c9da8694622cf14da915d08e145f0c31220 /libAACenc/src/aacenc_lib.cpp
parent9ee8fd55598983e94c56bcaba93820fc0e7da907 (diff)
downloadfdk-aac-a7c36cc207495967b4b31fbb86162860146281c6.tar.gz
fdk-aac-a7c36cc207495967b4b31fbb86162860146281c6.tar.bz2
fdk-aac-a7c36cc207495967b4b31fbb86162860146281c6.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 8a0819e..19546fc 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