summaryrefslogtreecommitdiffstats
path: root/libAACdec/src/aacdecoder_lib.cpp
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2013-11-01 10:46:40 +0200
committerMartin Storsjo <martin@martin.st>2013-11-01 10:46:40 +0200
commit321233ee92e138f44294c7bb9a375eadad9d24fa (patch)
tree1de928ad26325302f64c56603157f50095dcf2b1 /libAACdec/src/aacdecoder_lib.cpp
parentfcb5f1b692cb8343de35e69f9084328c652cf690 (diff)
parentfa3eba16446cc8f2f5e2dfc20d86a49dbd37299e (diff)
downloadfdk-aac-dabplus-321233ee92e138f44294c7bb9a375eadad9d24fa.tar.gz
fdk-aac-dabplus-321233ee92e138f44294c7bb9a375eadad9d24fa.tar.bz2
fdk-aac-dabplus-321233ee92e138f44294c7bb9a375eadad9d24fa.zip
Merge remote-tracking branch 'aosp/kitkat-release' into kitkat-merge
Conflicts: libAACenc/src/quantize.cpp
Diffstat (limited to 'libAACdec/src/aacdecoder_lib.cpp')
-rw-r--r--libAACdec/src/aacdecoder_lib.cpp34
1 files changed, 24 insertions, 10 deletions
diff --git a/libAACdec/src/aacdecoder_lib.cpp b/libAACdec/src/aacdecoder_lib.cpp
index a3db39e..ec8f41e 100644
--- a/libAACdec/src/aacdecoder_lib.cpp
+++ b/libAACdec/src/aacdecoder_lib.cpp
@@ -2,7 +2,7 @@
/* -----------------------------------------------------------------------------------------------------------
Software License for The Fraunhofer FDK AAC Codec Library for Android
-© Copyright 1995 - 2012 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.
+© Copyright 1995 - 2013 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.
All rights reserved.
1. INTRODUCTION
@@ -109,8 +109,8 @@ amm-info@iis.fraunhofer.de
/* Decoder library info */
#define AACDECODER_LIB_VL0 2
-#define AACDECODER_LIB_VL1 4
-#define AACDECODER_LIB_VL2 7
+#define AACDECODER_LIB_VL1 5
+#define AACDECODER_LIB_VL2 5
#define AACDECODER_LIB_TITLE "AAC Decoder Lib"
#define AACDECODER_LIB_BUILD_DATE __DATE__
#define AACDECODER_LIB_BUILD_TIME __TIME__
@@ -261,7 +261,7 @@ setConcealMethod ( const HANDLE_AACDECODER self, /*!< Handle of the decoder i
HANDLE_SBRDECODER hSbrDec = NULL;
HANDLE_AAC_DRC hDrcInfo = NULL;
HANDLE_PCM_DOWNMIX hPcmDmx = NULL;
- CConcealmentMethod backupMethod;
+ CConcealmentMethod backupMethod = ConcealMethodNone;
int backupDelay = 0;
int bsDelay = 0;
@@ -396,11 +396,15 @@ aacDecoder_SetParam ( const HANDLE_AACDECODER self, /*!< Handle of the decode
AAC_DECODER_ERROR errorStatus = AAC_DEC_OK;
CConcealParams *pConcealData = NULL;
HANDLE_AAC_DRC hDrcInfo = NULL;
+ HANDLE_PCM_DOWNMIX hPcmDmx = NULL;
/* check decoder handle */
if (self != NULL) {
pConcealData = &self->concealCommonData;
hDrcInfo = self->hDrcInfo;
+ hPcmDmx = self->hPcmUtils;
+ } else {
+ errorStatus = AAC_DEC_INVALID_HANDLE;
}
/* configure the subsystems */
@@ -417,11 +421,14 @@ aacDecoder_SetParam ( const HANDLE_AACDECODER self, /*!< Handle of the decode
break;
case AAC_PCM_OUTPUT_CHANNELS:
+ if (value < -1 || value > (6)) {
+ return AAC_DEC_SET_PARAM_FAIL;
+ }
{
PCMDMX_ERROR err;
err = pcmDmx_SetParam (
- self->hPcmUtils,
+ hPcmDmx,
NUMBER_OF_OUTPUT_CHANNELS,
value );
@@ -441,7 +448,7 @@ aacDecoder_SetParam ( const HANDLE_AACDECODER self, /*!< Handle of the decode
PCMDMX_ERROR err;
err = pcmDmx_SetParam (
- self->hPcmUtils,
+ hPcmDmx,
DUAL_CHANNEL_DOWNMIX_MODE,
value );
@@ -459,10 +466,14 @@ aacDecoder_SetParam ( const HANDLE_AACDECODER self, /*!< Handle of the decode
case AAC_PCM_OUTPUT_CHANNEL_MAPPING:
switch (value) {
case 0:
- self->channelOutputMapping = channelMappingTablePassthrough;
+ if (self != NULL) {
+ self->channelOutputMapping = channelMappingTablePassthrough;
+ }
break;
case 1:
- self->channelOutputMapping = channelMappingTableWAV;
+ if (self != NULL) {
+ self->channelOutputMapping = channelMappingTableWAV;
+ }
break;
default:
errorStatus = AAC_DEC_SET_PARAM_FAIL;
@@ -472,6 +483,9 @@ aacDecoder_SetParam ( const HANDLE_AACDECODER self, /*!< Handle of the decode
case AAC_QMF_LOWPOWER:
+ if (value < -1 || value > 1) {
+ return AAC_DEC_SET_PARAM_FAIL;
+ }
if (self == NULL) {
return AAC_DEC_INVALID_HANDLE;
}
@@ -794,8 +808,8 @@ LINKSPEC_CPP AAC_DECODER_ERROR aacDecoder_DecodeFrame(
/* Export data into streaminfo structure */
self->streamInfo.sampleRate = self->streamInfo.aacSampleRate;
self->streamInfo.frameSize = self->streamInfo.aacSamplesPerFrame;
- self->streamInfo.numChannels = self->aacChannels;
}
+ self->streamInfo.numChannels = self->streamInfo.aacNumChannels;
@@ -832,7 +846,7 @@ LINKSPEC_CPP AAC_DECODER_ERROR aacDecoder_DecodeFrame(
pTimeData,
&self->streamInfo.numChannels,
&self->streamInfo.sampleRate,
- self->channelOutputMapping[self->aacChannels-1],
+ self->channelOutputMapping[self->streamInfo.numChannels-1],
interleaved,
self->frameOK,
&self->psPossible);