aboutsummaryrefslogtreecommitdiffstats
path: root/src/mp4_decode.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-03-22 02:44:22 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-03-22 02:44:22 +0000
commit145f0b62d26974c5e15ad65c902045fe671a9d05 (patch)
treef86617eeae1a30f1e97a35507b93756a99cf0b29 /src/mp4_decode.c
parent4c1eb9225d5a741e1234d48eb38a8df3da908259 (diff)
downloadmpd-145f0b62d26974c5e15ad65c902045fe671a9d05.tar.gz
mpd-145f0b62d26974c5e15ad65c902045fe671a9d05.tar.xz
mpd-145f0b62d26974c5e15ad65c902045fe671a9d05.zip
aac decoding!
need to work on seeking for AAC also, don't reset cb->begin on seek to 0, instead just set cb->end=cb->begin, works much better for disabling seeking (like ADIF AAC's) git-svn-id: https://svn.musicpd.org/mpd/trunk@356 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/mp4_decode.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/mp4_decode.c b/src/mp4_decode.c
index a2cfc2ee0..d3c16b73e 100644
--- a/src/mp4_decode.c
+++ b/src/mp4_decode.c
@@ -2,8 +2,6 @@
* (c)2003-2004 by Warren Dukes (shank@mercury.chem.pitt.edu)
* This project's homepage is: http://www.musicpd.org
*
- * libaudiofile (wave) support added by Eric Wong <normalperson@yhbt.net>
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -149,7 +147,7 @@ int mp4_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc) {
if(faacDecInit2(decoder,mp4Buffer,mp4BufferSize,&sampleRate,&channels)
< 0)
{
- ERROR("Error initializing AAC decoder library.\n");
+ ERROR("Error not a AAC stream.\n");
faacDecClose(decoder);
mp4ff_close(mp4fh);
free(mp4cb);
@@ -210,7 +208,7 @@ int mp4_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc) {
if(dc->seek && seekPositionFound) {
seekPositionFound = 0;
chunkLen = 0;
- cb->end = 0;
+ cb->end = cb->begin;
cb->wrap = 0;
dc->seek = 0;
}
@@ -233,7 +231,7 @@ int mp4_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc) {
}
if(channels*(dur+offset) > frameInfo.samples) {
- dur = frameInfo.samples;
+ dur = frameInfo.samples/channels;
offset = 0;
}