diff options
Diffstat (limited to 'libmpcodecs/ad_faad.c')
-rw-r--r-- | libmpcodecs/ad_faad.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/libmpcodecs/ad_faad.c b/libmpcodecs/ad_faad.c index 226aed76f6..1e973119c2 100644 --- a/libmpcodecs/ad_faad.c +++ b/libmpcodecs/ad_faad.c @@ -28,7 +28,7 @@ #include "ad_internal.h" #include "libaf/reorder_ch.h" -static ad_info_t info = +static ad_info_t info = { "AAC (MPEG2/4 Advanced Audio Coding)", "faad", @@ -48,9 +48,9 @@ LIBAD_EXTERN(faad) /* configure maximum supported channels, * * this is theoretically max. 64 chans */ #define FAAD_MAX_CHANNELS 6 -#define FAAD_BUFFLEN (FAAD_MIN_STREAMSIZE*FAAD_MAX_CHANNELS) +#define FAAD_BUFFLEN (FAAD_MIN_STREAMSIZE*FAAD_MAX_CHANNELS) -//#define AAC_DUMP_COMPRESSED +//#define AAC_DUMP_COMPRESSED static faacDecHandle faac_hdec; static faacDecFrameInfo faac_finfo; @@ -80,7 +80,7 @@ static int aac_probe(unsigned char *buffer, int len) mp_msg(MSGT_DECAUDIO,MSGL_V, "\nAAC_PROBE: ret %d\n", pos); return pos; } - + static int init(sh_audio_t *sh) { unsigned long faac_samplerate; @@ -151,7 +151,7 @@ static int init(sh_audio_t *sh) faac_conf->downMatrix = 1; faacDecSetConfiguration(faac_hdec, faac_conf); } - + /*int i; for(i = 0; i < sh_audio->codecdata_len; i++) printf("codecdata_dump %d: 0x%02X\n", i, sh_audio->codecdata[i]);*/ @@ -175,9 +175,9 @@ static int init(sh_audio_t *sh) if(!sh->i_bps) { mp_msg(MSGT_DECAUDIO,MSGL_WARN,"FAAD: compressed input bitrate missing, assuming 128kbit/s!\n"); sh->i_bps = 128*1000/8; // XXX: HACK!!! ::atmos - } else + } else mp_msg(MSGT_DECAUDIO,MSGL_V,"FAAD: got %dkbit/s bitrate from MP4 header!\n",sh->i_bps*8/1000); - } + } return 1; } @@ -213,7 +213,7 @@ static int control(sh_audio_t *sh,int cmd,void* arg, ...) case ADCTRL_RESYNC_STREAM: aac_sync(sh); return CONTROL_TRUE; -#if 0 +#if 0 case ADCTRL_SKIP_FRAME: return CONTROL_TRUE; #endif @@ -237,7 +237,7 @@ static int decode_audio(sh_audio_t *sh,unsigned char *buf,int minlen,int maxlen) demux_read_data(sh->ds,&sh->a_in_buffer[sh->a_in_buffer_len], sh->a_in_buffer_size - sh->a_in_buffer_len); } - + #ifdef DUMP_AAC_COMPRESSED {int i; for (i = 0; i < 16; i++) @@ -249,7 +249,7 @@ static int decode_audio(sh_audio_t *sh,unsigned char *buf,int minlen,int maxlen) // raw aac stream: do { faac_sample_buffer = faacDecDecode(faac_hdec, &faac_finfo, sh->a_in_buffer, sh->a_in_buffer_len); - + /* update buffer index after faacDecDecode */ if(faac_finfo.bytesconsumed >= sh->a_in_buffer_len) { sh->a_in_buffer_len=0; @@ -271,7 +271,7 @@ static int decode_audio(sh_audio_t *sh,unsigned char *buf,int minlen,int maxlen) errors++; } else break; - } while(errors < MAX_FAAD_ERRORS); + } while(errors < MAX_FAAD_ERRORS); } else { // packetized (.mp4) aac stream: unsigned char* bufptr=NULL; @@ -285,7 +285,7 @@ static int decode_audio(sh_audio_t *sh,unsigned char *buf,int minlen,int maxlen) faac_sample_buffer = faacDecDecode(faac_hdec, &faac_finfo, bufptr, buflen); } //for (j=0;j<faac_finfo.channels;j++) printf("%d:%d\n", j, faac_finfo.channel_position[j]); - + if(faac_finfo.error > 0) { mp_msg(MSGT_DECAUDIO,MSGL_WARN,"FAAD: Failed to decode frame: %s \n", faacDecGetErrorMessage(faac_finfo.error)); |