summaryrefslogtreecommitdiffstats
path: root/libAACdec
diff options
context:
space:
mode:
Diffstat (limited to 'libAACdec')
-rw-r--r--libAACdec/include/aacdecoder_lib.h3
-rw-r--r--libAACdec/src/aacdecoder.cpp6
-rw-r--r--libAACdec/src/aacdecoder_lib.cpp6
3 files changed, 8 insertions, 7 deletions
diff --git a/libAACdec/include/aacdecoder_lib.h b/libAACdec/include/aacdecoder_lib.h
index d275644..60efe8d 100644
--- a/libAACdec/include/aacdecoder_lib.h
+++ b/libAACdec/include/aacdecoder_lib.h
@@ -504,7 +504,8 @@ typedef struct
INT aacSamplesPerFrame; /*!< Samples per frame for the AAC core (from ASC). \n
1024 or 960 for AAC-LC \n
512 or 480 for AAC-LD and AAC-ELD */
-
+ INT aacNumChannels; /*!< The number of audio channels after AAC core processing (before PS or MPS processing).
+ CAUTION: This are not the final number of output channels! */
AUDIO_OBJECT_TYPE extAot; /*!< Extension Audio Object Type (from ASC) */
INT extSamplingRate; /*!< Extension sampling rate in Hz (from ASC) */
diff --git a/libAACdec/src/aacdecoder.cpp b/libAACdec/src/aacdecoder.cpp
index 20c7f60..3d00d34 100644
--- a/libAACdec/src/aacdecoder.cpp
+++ b/libAACdec/src/aacdecoder.cpp
@@ -183,7 +183,7 @@ void CAacDecoder_SyncQmfMode(HANDLE_AACDECODER self)
if ( self->qmfModeCurr == NOT_DEFINED )
{
if ( (IS_LOWDELAY(self->streamInfo.aot) && (self->flags & AC_MPS_PRESENT))
- || ( (self->ascChannels == 1)
+ || ( (self->streamInfo.aacNumChannels == 1)
&& ( (CAN_DO_PS(self->streamInfo.aot) && !(self->flags & AC_MPS_PRESENT))
|| ( IS_USAC(self->streamInfo.aot) && (self->flags & AC_MPS_PRESENT)) ) ) )
{
@@ -196,7 +196,7 @@ void CAacDecoder_SyncQmfMode(HANDLE_AACDECODER self)
/* Set SBR to current QMF mode. Error does not matter. */
sbrDecoder_SetParam(self->hSbrDecoder, SBR_QMF_MODE, (self->qmfModeCurr == MODE_LP));
- self->psPossible = ((CAN_DO_PS(self->streamInfo.aot) && self->aacChannels == 1 && ! (self->flags & AC_MPS_PRESENT))) && self->qmfModeCurr == MODE_HQ ;
+ self->psPossible = ((CAN_DO_PS(self->streamInfo.aot) && self->streamInfo.aacNumChannels == 1 && ! (self->flags & AC_MPS_PRESENT))) && self->qmfModeCurr == MODE_HQ ;
FDK_ASSERT( ! ( (self->flags & AC_MPS_PRESENT) && self->psPossible ) );
}
@@ -1573,7 +1573,7 @@ LINKSPEC_CPP AAC_DECODER_ERROR CAacDecoder_DecodeFrame(
}
/* Update number of output channels */
- self->streamInfo.numChannels = aacChannels;
+ self->streamInfo.aacNumChannels = aacChannels;
#ifdef TP_PCE_ENABLE
if (pceRead == 1 && CProgramConfig_IsValid(pce)) {
diff --git a/libAACdec/src/aacdecoder_lib.cpp b/libAACdec/src/aacdecoder_lib.cpp
index 1dedf68..5f0be30 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 1
+#define AACDECODER_LIB_VL2 2
#define AACDECODER_LIB_TITLE "AAC Decoder Lib"
#define AACDECODER_LIB_BUILD_DATE __DATE__
#define AACDECODER_LIB_BUILD_TIME __TIME__
@@ -794,8 +794,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 +832,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);