ref: 9fb151c0a1fbf4c956982ec1b93d59c36681f49f
parent: 068acec8fe917fe572cbf11d0732bb0359be0321
author: menno <menno>
date: Sun Feb 9 15:42:52 EST 2003
Updated interface function for mp4 AudioSpecificConfig now is a lot cleaner to use
--- a/aacDECdrop/decode.c
+++ b/aacDECdrop/decode.c
@@ -16,8 +16,8 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: decode.c,v 1.11 2002/11/01 11:19:34 menno Exp $
-** $Id: decode.c,v 1.11 2002/11/01 11:19:34 menno Exp $
+** $Id: decode.c,v 1.12 2003/02/09 20:42:46 menno Exp $
+** $Id: decode.c,v 1.12 2003/02/09 20:42:46 menno Exp $
**/
#ifdef _WIN32
@@ -280,15 +280,13 @@
{
unsigned char *buff = NULL;
int buff_size = 0;
- unsigned long dummy1_32;
- unsigned char dummy2_8, dummy3_8, dummy4_8, dummy5_8, dummy6_8,
- dummy7_8, dummy8_8;
+ mp4AudioSpecificConfig mp4ASC;
+
MP4GetTrackESConfiguration(infile, trackId, &buff, &buff_size);
if (buff)
{
- rc = AudioSpecificConfig(buff, buff_size, &dummy1_32, &dummy2_8,
- &dummy3_8, &dummy4_8, &dummy5_8, &dummy6_8, &dummy7_8, &dummy8_8);
+ rc = AudioSpecificConfig(buff, buff_size, &mp4ASC);
free(buff);
if (rc < 0)
--- a/frontend/main.c
+++ b/frontend/main.c
@@ -16,7 +16,7 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: main.c,v 1.26 2003/02/06 20:01:51 menno Exp $
+** $Id: main.c,v 1.27 2003/02/09 20:42:47 menno Exp $
**/
#ifdef _WIN32
@@ -305,15 +305,12 @@
{
unsigned char *buff = NULL;
int buff_size = 0;
- unsigned long dummy1_32;
- unsigned char dummy2_8, dummy3_8, dummy4_8, dummy5_8, dummy6_8,
- dummy7_8, dummy8_8;
+ mp4AudioSpecificConfig mp4ASC;
MP4GetTrackESConfiguration(infile, trackId, &buff, &buff_size);
if (buff)
{
- rc = AudioSpecificConfig(buff, buff_size, &dummy1_32, &dummy2_8,
- &dummy3_8, &dummy4_8, &dummy5_8, &dummy6_8, &dummy7_8, &dummy8_8);
+ rc = AudioSpecificConfig(buff, buff_size, &mp4ASC);
free(buff);
if (rc < 0)
--- a/include/faad.h
+++ b/include/faad.h
@@ -16,7 +16,7 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: faad.h,v 1.18 2003/02/06 20:01:51 menno Exp $
+** $Id: faad.h,v 1.19 2003/02/09 20:42:48 menno Exp $
**/
#ifndef __AACDEC_H__
@@ -71,7 +71,26 @@
typedef void *faacDecHandle;
+typedef struct mp4AudioSpecificConfig
+{
+ /* Audio Specific Info */
+ unsigned char objectTypeIndex;
+ unsigned char samplingFrequencyIndex;
+ unsigned long samplingFrequency;
+ unsigned char channelsConfiguration;
+ /* GA Specific Info */
+ unsigned char frameLengthFlag;
+ unsigned char dependsOnCoreCoder;
+ unsigned long coreCoderDelay;
+ unsigned char extensionFlag;
+ unsigned char aacSectionDataResilienceFlag;
+ unsigned char aacScalefactorDataResilienceFlag;
+ unsigned char aacSpectralDataResilienceFlag;
+ unsigned char epConfig;
+
+} mp4AudioSpecificConfig;
+
typedef struct faacDecConfiguration
{
unsigned char defObjectType;
@@ -122,14 +141,7 @@
char FAADAPI AudioSpecificConfig(unsigned char *pBuffer,
unsigned long buffer_size,
- unsigned long *samplerate,
- unsigned char *channels,
- unsigned char *sf_index,
- unsigned char *object_type,
- unsigned char *aacSectionDataResilienceFlag,
- unsigned char *aacScalefactorDataResilienceFlag,
- unsigned char *aacSpectralDataResilienceFlag,
- unsigned char *frameLengthFlag);
+ mp4AudioSpecificConfig *mp4ASC);
#ifdef _WIN32
#pragma pack(pop)
--- a/libfaad/decoder.c
+++ b/libfaad/decoder.c
@@ -16,7 +16,7 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: decoder.c,v 1.49 2003/02/06 20:01:52 menno Exp $
+** $Id: decoder.c,v 1.50 2003/02/09 20:42:49 menno Exp $
**/
#include "common.h"
@@ -207,7 +207,7 @@
uint32_t *samplerate, uint8_t *channels)
{
int8_t rc;
- uint8_t frameLengthFlag;
+ mp4AudioSpecificConfig mp4ASC;
hDecoder->adif_header_present = 0;
hDecoder->adts_header_present = 0;
@@ -221,17 +221,18 @@
return -1;
}
- rc = AudioSpecificConfig(pBuffer, SizeOfDecoderSpecificInfo,
- samplerate, channels,
- &hDecoder->sf_index, &hDecoder->object_type,
-#ifdef ERROR_RESILIENCE
- &hDecoder->aacSectionDataResilienceFlag,
- &hDecoder->aacScalefactorDataResilienceFlag,
- &hDecoder->aacSpectralDataResilienceFlag,
-#else
- NULL, NULL, NULL,
-#endif
- &frameLengthFlag);
+ /* decode the audio specific config */
+ rc = AudioSpecificConfig(pBuffer, SizeOfDecoderSpecificInfo, &mp4ASC);
+
+ /* copy the relevant info to the decoder handle */
+ *samplerate = mp4ASC.samplingFrequency;
+ *channels = mp4ASC.channelsConfiguration;
+ hDecoder->sf_index = mp4ASC.samplingFrequencyIndex;
+ hDecoder->object_type = mp4ASC.objectTypeIndex;
+ hDecoder->aacSectionDataResilienceFlag = mp4ASC.aacSectionDataResilienceFlag;
+ hDecoder->aacScalefactorDataResilienceFlag = mp4ASC.aacScalefactorDataResilienceFlag;
+ hDecoder->aacSpectralDataResilienceFlag = mp4ASC.aacSpectralDataResilienceFlag;
+
if (hDecoder->object_type < 5)
hDecoder->object_type--; /* For AAC differs from MPEG-4 */
if (rc != 0)
@@ -239,7 +240,7 @@
return rc;
}
hDecoder->channelConfiguration = *channels;
- if (frameLengthFlag)
+ if (mp4ASC.frameLengthFlag)
hDecoder->frameLength = 960;
/* must be done before frameLength is divided by 2 for LD */
--- a/libfaad/libfaad.dsp
+++ b/libfaad/libfaad.dsp
@@ -259,6 +259,10 @@
# End Source File
# Begin Source File
+SOURCE=.\cfft_tab.h
+# End Source File
+# Begin Source File
+
SOURCE=.\common.h
# End Source File
# Begin Source File
@@ -303,6 +307,10 @@
# End Source File
# Begin Source File
+SOURCE=.\iq_table.h
+# End Source File
+# Begin Source File
+
SOURCE=.\is.h
# End Source File
# Begin Source File
@@ -340,6 +348,10 @@
# Begin Source File
SOURCE=.\rvlc.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\sine_win.h
# End Source File
# Begin Source File
--- a/libfaad/mp4.c
+++ b/libfaad/mp4.c
@@ -16,12 +16,14 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: mp4.c,v 1.13 2002/11/28 18:48:30 menno Exp $
+** $Id: mp4.c,v 1.14 2003/02/09 20:42:49 menno Exp $
**/
#include "common.h"
#include "structs.h"
+#include <stdlib.h>
+
#include "bits.h"
#include "mp4.h"
#include "data.h"
@@ -102,52 +104,45 @@
/* Table 1.6.1 */
int8_t FAADAPI AudioSpecificConfig(uint8_t *pBuffer,
uint32_t buffer_size,
- uint32_t *samplerate,
- uint8_t *channels,
- uint8_t *sf_index,
- uint8_t *object_type,
- uint8_t *aacSectionDataResilienceFlag,
- uint8_t *aacScalefactorDataResilienceFlag,
- uint8_t *aacSpectralDataResilienceFlag,
- uint8_t *frameLengthFlag)
+ mp4AudioSpecificConfig *mp4ASC)
{
bitfile ld;
- uint8_t ep_config = 0;
int8_t result = 0;
- uint8_t ObjectTypeIndex, SamplingFrequencyIndex, ChannelsConfiguration;
+ if (pBuffer == NULL)
+ return -7;
+ if (mp4ASC == NULL)
+ return -8;
+
+ memset(mp4ASC, 0, sizeof(mp4AudioSpecificConfig));
+
faad_initbits(&ld, pBuffer, buffer_size);
faad_byte_align(&ld);
- ObjectTypeIndex = (uint8_t)faad_getbits(&ld, 5
+ mp4ASC->objectTypeIndex = (uint8_t)faad_getbits(&ld, 5
DEBUGVAR(1,1,"parse_audio_decoder_specific_info(): ObjectTypeIndex"));
- SamplingFrequencyIndex = (uint8_t)faad_getbits(&ld, 4
+ mp4ASC->samplingFrequencyIndex = (uint8_t)faad_getbits(&ld, 4
DEBUGVAR(1,2,"parse_audio_decoder_specific_info(): SamplingFrequencyIndex"));
- ChannelsConfiguration = (uint8_t)faad_getbits(&ld, 4
+ mp4ASC->channelsConfiguration = (uint8_t)faad_getbits(&ld, 4
DEBUGVAR(1,3,"parse_audio_decoder_specific_info(): ChannelsConfiguration"));
- *samplerate = sample_rates[SamplingFrequencyIndex];
+ mp4ASC->samplingFrequency = sample_rates[mp4ASC->samplingFrequencyIndex];
- *channels = ChannelsConfiguration;
-
- *sf_index = SamplingFrequencyIndex;
- *object_type = ObjectTypeIndex;
-
- if (ObjectTypesTable[ObjectTypeIndex] != 1)
+ if (ObjectTypesTable[mp4ASC->objectTypeIndex] != 1)
{
faad_endbits(&ld);
return -1;
}
- if (*samplerate == 0)
+ if (mp4ASC->samplingFrequency == 0)
{
faad_endbits(&ld);
return -2;
}
- if (ChannelsConfiguration > 7)
+ if (mp4ASC->channelsConfiguration > 7)
{
faad_endbits(&ld);
return -3;
@@ -154,32 +149,22 @@
}
/* get GASpecificConfig */
- if (ObjectTypeIndex == 1 || ObjectTypeIndex == 2 ||
- ObjectTypeIndex == 3 || ObjectTypeIndex == 4 ||
- ObjectTypeIndex == 6 || ObjectTypeIndex == 7)
+ if (mp4ASC->objectTypeIndex == 1 || mp4ASC->objectTypeIndex == 2 ||
+ mp4ASC->objectTypeIndex == 3 || mp4ASC->objectTypeIndex == 4 ||
+ mp4ASC->objectTypeIndex == 6 || mp4ASC->objectTypeIndex == 7)
{
- result = GASpecificConfig(&ld, channels, ObjectTypeIndex,
+ result = GASpecificConfig(&ld, mp4ASC);
+
#ifdef ERROR_RESILIENCE
- aacSectionDataResilienceFlag,
- aacScalefactorDataResilienceFlag,
- aacSpectralDataResilienceFlag,
-#endif
- frameLengthFlag);
-#ifdef ERROR_RESILIENCE
- } else if (ObjectTypeIndex >= ER_OBJECT_START) { /* ER */
- result = GASpecificConfig(&ld, channels, ObjectTypeIndex,
-#ifdef ERROR_RESILIENCE
- aacSectionDataResilienceFlag,
- aacScalefactorDataResilienceFlag,
- aacSpectralDataResilienceFlag,
-#endif
- frameLengthFlag);
- ep_config = (uint8_t)faad_getbits(&ld, 2
+ } else if (mp4ASC->objectTypeIndex >= ER_OBJECT_START) { /* ER */
+ result = GASpecificConfig(&ld, mp4ASC);
+ mp4ASC->epConfig = (uint8_t)faad_getbits(&ld, 2
DEBUGVAR(1,143,"parse_audio_decoder_specific_info(): epConfig"));
- if (ep_config != 0)
+ if (mp4ASC->epConfig != 0)
result = -5;
#endif
+
} else {
result = -4;
}
@@ -186,7 +171,7 @@
#ifdef SSR_DEC
/* shorter frames not allowed for SSR */
- if ((ObjectTypeIndex == 4) && *frameLengthFlag)
+ if ((mp4ASC->objectTypeIndex == 4) && mp4ASC->frameLengthFlag)
return -6;
#endif
--- a/libfaad/mp4.h
+++ b/libfaad/mp4.h
@@ -16,7 +16,7 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: mp4.h,v 1.6 2002/11/01 11:19:36 menno Exp $
+** $Id: mp4.h,v 1.7 2003/02/09 20:42:49 menno Exp $
**/
#ifndef __MP4_H__
@@ -30,14 +30,7 @@
int8_t FAADAPI AudioSpecificConfig(uint8_t *pBuffer,
uint32_t buffer_size,
- uint32_t *samplerate,
- uint8_t *channels,
- uint8_t *sf_index,
- uint8_t *object_type,
- uint8_t *aacSectionDataResilienceFlag,
- uint8_t *aacScalefactorDataResilienceFlag,
- uint8_t *aacSpectralDataResilienceFlag,
- uint8_t *frameLengthFlag);
+ mp4AudioSpecificConfig *mp4ASC);
#ifdef __cplusplus
}
--- a/libfaad/structs.h
+++ b/libfaad/structs.h
@@ -16,7 +16,7 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: structs.h,v 1.4 2003/02/06 20:01:53 menno Exp $
+** $Id: structs.h,v 1.5 2003/02/09 20:42:49 menno Exp $
**/
#ifndef __STRUCTS_H__
@@ -279,6 +279,26 @@
ic_stream ics1;
ic_stream ics2;
} element; /* syntax element (SCE, CPE, LFE) */
+
+typedef struct mp4AudioSpecificConfig
+{
+ /* Audio Specific Info */
+ uint8_t objectTypeIndex;
+ uint8_t samplingFrequencyIndex;
+ uint32_t samplingFrequency;
+ uint8_t channelsConfiguration;
+
+ /* GA Specific Info */
+ uint8_t frameLengthFlag;
+ uint8_t dependsOnCoreCoder;
+ uint16_t coreCoderDelay;
+ uint8_t extensionFlag;
+ uint8_t aacSectionDataResilienceFlag;
+ uint8_t aacScalefactorDataResilienceFlag;
+ uint8_t aacSpectralDataResilienceFlag;
+ uint8_t epConfig;
+
+} mp4AudioSpecificConfig;
typedef struct faacDecConfiguration
{
--- a/libfaad/syntax.c
+++ b/libfaad/syntax.c
@@ -16,7 +16,7 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: syntax.c,v 1.38 2003/01/17 14:56:18 menno Exp $
+** $Id: syntax.c,v 1.39 2003/02/09 20:42:49 menno Exp $
**/
/*
@@ -44,36 +44,27 @@
/* Table 4.4.1 */
-int8_t GASpecificConfig(bitfile *ld, uint8_t *channelConfiguration,
- uint8_t object_type,
-#ifdef ERROR_RESILIENCE
- uint8_t *aacSectionDataResilienceFlag,
- uint8_t *aacScalefactorDataResilienceFlag,
- uint8_t *aacSpectralDataResilienceFlag,
-#endif
- uint8_t *frameLengthFlag)
+int8_t GASpecificConfig(bitfile *ld, mp4AudioSpecificConfig *mp4ASC)
{
- uint8_t dependsOnCoreCoder, extensionFlag;
- uint16_t coreCoderDelay;
program_config pce;
/* 1024 or 960 */
- *frameLengthFlag = faad_get1bit(ld
+ mp4ASC->frameLengthFlag = faad_get1bit(ld
DEBUGVAR(1,138,"GASpecificConfig(): FrameLengthFlag"));
- dependsOnCoreCoder = faad_get1bit(ld
+ mp4ASC->dependsOnCoreCoder = faad_get1bit(ld
DEBUGVAR(1,139,"GASpecificConfig(): DependsOnCoreCoder"));
- if (dependsOnCoreCoder == 1)
+ if (mp4ASC->dependsOnCoreCoder == 1)
{
- coreCoderDelay = (uint16_t)faad_getbits(ld, 14
+ mp4ASC->coreCoderDelay = (uint16_t)faad_getbits(ld, 14
DEBUGVAR(1,140,"GASpecificConfig(): CoreCoderDelay"));
}
- extensionFlag = faad_get1bit(ld DEBUGVAR(1,141,"GASpecificConfig(): ExtensionFlag"));
- if (*channelConfiguration == 0)
+ mp4ASC->extensionFlag = faad_get1bit(ld DEBUGVAR(1,141,"GASpecificConfig(): ExtensionFlag"));
+ if (mp4ASC->channelsConfiguration == 0)
{
program_config_element(&pce, ld);
- *channelConfiguration = pce.channels;
+ mp4ASC->channelsConfiguration = pce.channels;
if (pce.num_valid_cc_elements)
return -3;
@@ -80,16 +71,16 @@
}
#ifdef ERROR_RESILIENCE
- if (extensionFlag == 1)
+ if (mp4ASC->extensionFlag == 1)
{
/* Error resilience not supported yet */
- if (object_type >= ER_OBJECT_START)
+ if (mp4ASC->objectTypeIndex >= ER_OBJECT_START)
{
- *aacSectionDataResilienceFlag = faad_get1bit(ld
+ mp4ASC->aacSectionDataResilienceFlag = faad_get1bit(ld
DEBUGVAR(1,144,"GASpecificConfig(): aacSectionDataResilienceFlag"));
- *aacScalefactorDataResilienceFlag = faad_get1bit(ld
+ mp4ASC->aacScalefactorDataResilienceFlag = faad_get1bit(ld
DEBUGVAR(1,145,"GASpecificConfig(): aacScalefactorDataResilienceFlag"));
- *aacSpectralDataResilienceFlag = faad_get1bit(ld
+ mp4ASC->aacSpectralDataResilienceFlag = faad_get1bit(ld
DEBUGVAR(1,146,"GASpecificConfig(): aacSpectralDataResilienceFlag"));
/* 1 bit: extensionFlag3 */
--- a/libfaad/syntax.h
+++ b/libfaad/syntax.h
@@ -16,7 +16,7 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: syntax.h,v 1.24 2002/12/22 19:58:31 menno Exp $
+** $Id: syntax.h,v 1.25 2003/02/09 20:42:49 menno Exp $
**/
#ifndef __SYNTAX_H__
@@ -81,14 +81,7 @@
#define INTENSITY_HCB 15
-int8_t GASpecificConfig(bitfile *ld, uint8_t *channelConfiguration,
- uint8_t object_type,
-#ifdef ERROR_RESILIENCE
- uint8_t *aacSectionDataResilienceFlag,
- uint8_t *aacScalefactorDataResilienceFlag,
- uint8_t *aacSpectralDataResilienceFlag,
-#endif
- uint8_t *frameLengthFlag);
+int8_t GASpecificConfig(bitfile *ld, mp4AudioSpecificConfig *mp4ASC);
uint8_t adts_frame(adts_header *adts, bitfile *ld);
void get_adif_header(adif_header *adif, bitfile *ld);
--- a/plugins/foo_mp4/foo_mp4.cpp
+++ b/plugins/foo_mp4/foo_mp4.cpp
@@ -16,7 +16,7 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: foo_mp4.cpp,v 1.13 2003/02/04 16:49:38 menno Exp $
+** $Id: foo_mp4.cpp,v 1.14 2003/02/09 20:42:50 menno Exp $
**/
#include <mp4.h>
@@ -255,16 +255,14 @@
{
unsigned char *buff = NULL;
int buff_size = 0;
- unsigned long dummy1_32;
- unsigned char dummy2_8, dummy3_8, dummy4_8, dummy5_8, dummy6_8,
- dummy7_8, dummy8_8;
+ mp4AudioSpecificConfig mp4ASC;
+
MP4GetTrackESConfiguration(infile, trackId,
(unsigned __int8**)&buff, (unsigned __int32*)&buff_size);
if (buff)
{
- rc = AudioSpecificConfig(buff, buff_size, &dummy1_32, &dummy2_8,
- &dummy3_8, &dummy4_8, &dummy5_8, &dummy6_8, &dummy7_8, &dummy8_8);
+ rc = AudioSpecificConfig(buff, buff_size, &mp4ASC);
free(buff);
if (rc < 0)
--- a/plugins/in_mp4/utils.c
+++ b/plugins/in_mp4/utils.c
@@ -16,7 +16,7 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: utils.c,v 1.4 2002/11/01 11:19:36 menno Exp $
+** $Id: utils.c,v 1.5 2003/02/09 20:42:52 menno Exp $
**/
#define WIN32_LEAN_AND_MEAN
@@ -56,15 +56,13 @@
{
unsigned char *buff = NULL;
int buff_size = 0;
- unsigned char dummy2_8, dummy3_8, dummy4_8, dummy5_8, dummy6_8,
- dummy7_8, dummy8_8;
- unsigned int dummy1_32;
+ mp4AudioSpecificConfig mp4ASC;
+
MP4GetTrackESConfiguration(infile, trackId, &buff, &buff_size);
if (buff)
{
- rc = AudioSpecificConfig(buff, buff_size, &dummy1_32, &dummy2_8,
- &dummy3_8, &dummy4_8, &dummy5_8, &dummy6_8, &dummy7_8, &dummy8_8);
+ rc = AudioSpecificConfig(buff, buff_size, &mp4ASC);
free(buff);
if (rc < 0)
--- a/plugins/winamp3/FAAD.cpp
+++ b/plugins/winamp3/FAAD.cpp
@@ -130,16 +130,13 @@
{
unsigned char *buff = NULL;
unsigned __int32 buff_size = 0;
- unsigned char dummy2_8, dummy3_8, dummy4_8, dummy5_8, dummy6_8,
- dummy7_8, dummy8_8;
- unsigned long dummy1_32;
+ mp4AudioSpecific mp4ASC;
MP4GetTrackESConfiguration(infile, trackId, (unsigned __int8 **)&buff, &buff_size);
if (buff)
{
- rc = AudioSpecificConfig(buff, buff_size,&dummy1_32, &dummy2_8,
- &dummy3_8, &dummy4_8, &dummy5_8, &dummy6_8, &dummy7_8, &dummy8_8);
+ rc = AudioSpecificConfig(buff, buff_size, &mp4ASC);
free(buff);
if (rc < 0)
@@ -221,7 +218,8 @@
MP4Duration length;
unsigned __int32 buffer_size;
DWORD timeScale;
- BYTE sf, dummy8;
+ BYTE sf;
+ mp4AudioSpecificInfo mp4ASC;
if(!(mp4File=MP4Read(infos->getFilename(), 0)))
ERROR_getInfos("Error opening file");
@@ -235,8 +233,11 @@
MP4GetTrackESConfiguration(mp4File, track, (unsigned __int8 **)&buffer, &buffer_size);
if(!buffer)
ERROR_getInfos("MP4GetTrackESConfiguration");
- AudioSpecificConfig(buffer, buffer_size, &timeScale, &Channels, &sf, &type,
- &dummy8, &dummy8, &dummy8, &dummy8);
+ AudioSpecificConfig(buffer, buffer_size, &mp4ASC);
+ timeScale = mp4ASC.samplingFrequency;
+ Channels = mp4ASC.channelsConfiguration;
+ sf = mp4ASC.samplingFrequencyIndex;
+ type = mp4ASC.objectTypeIndex;
if(faacDecInit2(hDecoder, buffer, buffer_size, &Samplerate, &Channels) < 0)
ERROR_getInfos("Error initializing decoder library");
FREE_ARRAY(buffer);