aboutsummaryrefslogtreecommitdiffstats
path: root/src/mp4_decode.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-03-25 01:08:13 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-03-25 01:08:13 +0000
commit1de1bfe314bb8c48b3e508f5001927988588fcf6 (patch)
treee6ce56cbabdcd4420b16c4dd9e9707205c5619f1 /src/mp4_decode.c
parent63a62a45142380d67db3d2d5cb57891b2c9371e7 (diff)
downloadmpd-1de1bfe314bb8c48b3e508f5001927988588fcf6.tar.gz
mpd-1de1bfe314bb8c48b3e508f5001927988588fcf6.tar.xz
mpd-1de1bfe314bb8c48b3e508f5001927988588fcf6.zip
fix and detect differences between faad2 1.1 and 2.0
git-svn-id: https://svn.musicpd.org/mpd/trunk@459 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/mp4_decode.c')
-rw-r--r--src/mp4_decode.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/mp4_decode.c b/src/mp4_decode.c
index 6ecce1853..a697a8b3d 100644
--- a/src/mp4_decode.c
+++ b/src/mp4_decode.c
@@ -44,12 +44,24 @@ int mp4_getAACTrack(mp4ff_t *infile) {
for (i = 0; i < numTracks; i++) {
unsigned char *buff = NULL;
int buff_size = 0;
+#ifdef HAVE_MP4AUDIOSPECIFICCONFIG
mp4AudioSpecificConfig mp4ASC;
+#else
+ unsigned long dummy1_32;
+ unsigned char dummy2_8, dummy3_8, dummy4_8, dummy5_8, dummy6_8,
+ dummy7_8, dummy8_8;
+#endif
mp4ff_get_decoder_config(infile, i, &buff, &buff_size);
if (buff) {
+#ifdef HAVE_MP4AUDIOSPECIFICCONFIG
rc = AudioSpecificConfig(buff, buff_size, &mp4ASC);
+#else
+ rc = AudioSpecificConfig(buff, &dummy1_32, &dummy2_8,
+ &dummy3_8, &dummy4_8, &dummy5_8,
+ &dummy6_8, &dummy7_8, &dummy8_8);
+#endif
free(buff);
if (rc < 0) continue;
return i;
@@ -220,8 +232,12 @@ int mp4_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc) {
continue;
}
+#ifdef HAVE_FAAD_BUFLEN_FUNCS
sampleBuffer = faacDecDecode(decoder,&frameInfo,mp4Buffer,
mp4BufferSize);
+#else
+ sampleBuffer = faacDecDecode(decoder,&frameInfo,mp4Buffer);
+#endif
if(mp4Buffer) free(mp4Buffer);
if(frameInfo.error > 0) {
@@ -234,9 +250,11 @@ int mp4_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc) {
if(dc->start) {
channels = frameInfo.channels;
+#ifdef HAVE_FAACDECFRAMEINFO_SAMPLERATE
scale = frameInfo.samplerate;
+#endif
+ af->sampleRate = scale;
af->channels = frameInfo.channels;
- af->sampleRate = frameInfo.samplerate;
dc->state = DECODE_STATE_DECODE;
dc->start = 0;
}