summaryrefslogtreecommitdiffstats
path: root/libAACdec/src/aacdecoder_lib.cpp
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2013-08-27 16:28:09 -0700
committerJean-Michel Trivi <jmtrivi@google.com>2013-08-27 16:28:09 -0700
commit5016eb7f6582fbb2d72d79be782325a12df08864 (patch)
treebc2325ebc6840a20d25f35a0c5a6a13454d2e402 /libAACdec/src/aacdecoder_lib.cpp
parentb9774f90651be61065ae40171fc321f6ced60e49 (diff)
downloadandroid_external_aac-5016eb7f6582fbb2d72d79be782325a12df08864.tar.gz
android_external_aac-5016eb7f6582fbb2d72d79be782325a12df08864.tar.bz2
android_external_aac-5016eb7f6582fbb2d72d79be782325a12df08864.zip
Decoder stability, sanity checks improvements
* AAC-Decoder - Improved PCE handling for saver (re-)configuration and metadata processing. Modified file(s): libAACdec/src/aacdecoder.cpp libAACdec/src/aacdecoder_lib.cpp - Transport layer changes (config found) -> to be evaluated. Modified file(s): libMpegTPDec/include/tpdec_lib.h libMpegTPDec/src/tpdec_latm.h libMpegTPDec/src/version libMpegTPDec/src/tpdec_asc.cpp libMpegTPDec/src/tpdec_lib.cpp libMpegTPDec/src/tpdec_adts.cpp libMpegTPDec/src/tpdec_latm.cpp libSYS/include/FDK_audio.h libSYS/src/genericStds.cpp - Enable concealment state machine to skip states if the corresponding parameter is set to zero. Modified file(s): libAACdec/src/conceal.cpp - Add some more sanity checks to avoid segmentation faults especially when setting dynamic API params. Modified file(s): libAACdec/src/aacdecoder_lib.cpp - Fix to do a fail-safe initialization of IMDCT for all channels even with corrupt streams. Modified file(s): libAACdec/src/aacdecoder.cpp - HCR decoder fix (remove warnings). Modified file(s): libAACdec/src/block.cpp - Fix border calculation in SBR decoder's LPP transposer patch determination. Modified file(s): libSBRdec/src/env_dec.cpp libSBRdec/src/sbrdecoder.cpp libSBRdec/src/lpp_tran.cpp Bug 9428126 Change-Id: Ib415b702b88a7ec8e9a55789d79cafb39296d26b
Diffstat (limited to 'libAACdec/src/aacdecoder_lib.cpp')
-rw-r--r--libAACdec/src/aacdecoder_lib.cpp26
1 files changed, 20 insertions, 6 deletions
diff --git a/libAACdec/src/aacdecoder_lib.cpp b/libAACdec/src/aacdecoder_lib.cpp
index 247fcef..9a70f24 100644
--- a/libAACdec/src/aacdecoder_lib.cpp
+++ b/libAACdec/src/aacdecoder_lib.cpp
@@ -110,7 +110,7 @@ amm-info@iis.fraunhofer.de
/* Decoder library info */
#define AACDECODER_LIB_VL0 2
#define AACDECODER_LIB_VL1 5
-#define AACDECODER_LIB_VL2 3
+#define AACDECODER_LIB_VL2 4
#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;
}