ad_faad: fix compilation using external libfaad

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31603 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
attila 2010-07-01 19:59:42 +00:00 committed by Uoti Urpala
parent 4fc7f3b296
commit 4a0f67ca35
1 changed files with 11 additions and 0 deletions

View File

@ -126,6 +126,7 @@ static int init(sh_audio_t *sh)
faacDecSetConfiguration(faac_hdec, faac_conf);
sh->a_in_buffer_len = demux_read_data(sh->ds, sh->a_in_buffer, sh->a_in_buffer_size);
#if CONFIG_FAAD_INTERNAL
/* init the codec, look for LATM */
faac_init = faacDecInit(faac_hdec, sh->a_in_buffer,
sh->a_in_buffer_len, &faac_samplerate, &faac_channels,1);
@ -144,6 +145,11 @@ static int init(sh_audio_t *sh)
if (faac_init >= 0) break;
}
}
#else
/* external faad does not have latm lookup support */
faac_init = faacDecInit(faac_hdec, sh->a_in_buffer,
sh->a_in_buffer_len, &faac_samplerate, &faac_channels);
#endif
if (faac_init < 0) {
pos = aac_probe(sh->a_in_buffer, sh->a_in_buffer_len);
@ -157,8 +163,13 @@ static int init(sh_audio_t *sh)
}
/* init the codec */
#if CONFIG_FAAD_INTERNAL
faac_init = faacDecInit(faac_hdec, sh->a_in_buffer,
sh->a_in_buffer_len, &faac_samplerate, &faac_channels,0);
#else
faac_init = faacDecInit(faac_hdec, sh->a_in_buffer,
sh->a_in_buffer_len, &faac_samplerate, &faac_channels);
#endif
}
sh->a_in_buffer_len -= (faac_init > 0)?faac_init:0; // how many bytes init consumed