diff options
author | Xin Li <delphij@google.com> | 2021-10-07 23:50:23 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2021-10-07 23:50:23 +0000 |
commit | 0bfa3fc1cd1c7ef3e563aa5506ee16cfb1ed4494 (patch) | |
tree | c6a1ddee22e29d9ea00ec2523071a711368189cd /libAACenc/src | |
parent | 6d10f91a77002b6371ebada491f507ef974ca572 (diff) | |
parent | 1b5221d9fee482e03342eb1593f580754fa7ab3f (diff) | |
download | fdk-aac-0bfa3fc1cd1c7ef3e563aa5506ee16cfb1ed4494.tar.gz fdk-aac-0bfa3fc1cd1c7ef3e563aa5506ee16cfb1ed4494.tar.bz2 fdk-aac-0bfa3fc1cd1c7ef3e563aa5506ee16cfb1ed4494.zip |
Merge "Merge Android 12"
Diffstat (limited to 'libAACenc/src')
-rw-r--r-- | libAACenc/src/aacenc_lib.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/libAACenc/src/aacenc_lib.cpp b/libAACenc/src/aacenc_lib.cpp index 0ae329b..c11db27 100644 --- a/libAACenc/src/aacenc_lib.cpp +++ b/libAACenc/src/aacenc_lib.cpp @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android -© Copyright 1995 - 2019 Fraunhofer-Gesellschaft zur Förderung der angewandten +© Copyright 1995 - 2021 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION @@ -1242,7 +1242,7 @@ static INT aacenc_SbrCallback(void *self, HANDLE_FDK_BITSTREAM hBs, INT aacenc_SscCallback(void *self, HANDLE_FDK_BITSTREAM hBs, const AUDIO_OBJECT_TYPE coreCodec, const INT samplingRate, const INT frameSize, - const INT stereoConfigIndex, + const INT numChannels, const INT stereoConfigIndex, const INT coreSbrFrameLengthIndex, const INT configBytes, const UCHAR configMode, UCHAR *configChanged) { HANDLE_AACENCODER hAacEncoder = (HANDLE_AACENCODER)self; @@ -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 @@ -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; @@ -2520,6 +2521,11 @@ AACENC_ERROR aacEncInfo(const HANDLE_AACENCODER hAacEncoder, AACENC_InfoStruct *pInfo) { AACENC_ERROR err = AACENC_OK; + if ((hAacEncoder == NULL) || (pInfo == NULL)) { + err = AACENC_INVALID_HANDLE; + goto bail; + } + FDKmemclear(pInfo, sizeof(AACENC_InfoStruct)); pInfo->confSize = 64; /* pre-initialize */ |