diff options
author | Max Kellermann <max@duempel.org> | 2008-08-26 08:27:13 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-08-26 08:27:13 +0200 |
commit | 7bbca0842de3947bf5a9a9897fd7d6c63a1eb6ec (patch) | |
tree | 2877824e90f116f8665b66b0be2baf999b7a5086 /src/inputPlugins/aac_plugin.c | |
parent | 468f61d587ab1a1289d1c31dd4f19ef2d8ba078d (diff) | |
download | mpd-7bbca0842de3947bf5a9a9897fd7d6c63a1eb6ec.tar.gz mpd-7bbca0842de3947bf5a9a9897fd7d6c63a1eb6ec.tar.xz mpd-7bbca0842de3947bf5a9a9897fd7d6c63a1eb6ec.zip |
added AacBuffer.decoder
We need the decoder object at several places in the AAC plugin. Add
it to mp3DecodeData, so we don't have to pass it around in every
function.
Diffstat (limited to 'src/inputPlugins/aac_plugin.c')
-rw-r--r-- | src/inputPlugins/aac_plugin.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/inputPlugins/aac_plugin.c b/src/inputPlugins/aac_plugin.c index c168e9bef..0d4e5bfa4 100644 --- a/src/inputPlugins/aac_plugin.c +++ b/src/inputPlugins/aac_plugin.c @@ -29,6 +29,7 @@ /* all code here is either based on or copied from FAAD2's frontend code */ typedef struct { + struct decoder *decoder; InputStream *inStream; size_t bytesIntoBuffer; size_t bytesConsumed; @@ -176,10 +177,12 @@ static void adtsParse(AacBuffer * b, float *length) *length = (float)frames / framesPerSec; } -static void initAacBuffer(InputStream * inStream, AacBuffer * b) +static void initAacBuffer(AacBuffer * b, + struct decoder *decoder, InputStream * inStream) { memset(b, 0, sizeof(AacBuffer)); + b->decoder = decoder; b->inStream = inStream; b->buffer = xmalloc(FAAD_MIN_STREAMSIZE * AAC_MAX_CHANNELS); @@ -259,7 +262,7 @@ static float getAacFloatTotalTime(char *file) if (openInputStream(&inStream, file) < 0) return -1; - initAacBuffer(&inStream, &b); + initAacBuffer(&b, NULL, &inStream); aac_parse_header(&b, &length); if (length < 0) { @@ -319,7 +322,7 @@ static int aac_stream_decode(struct decoder * mpd_decoder, AacBuffer b; int initialized = 0; - initAacBuffer(inStream, &b); + initAacBuffer(&b, mpd_decoder, inStream); decoder = faacDecOpen(); @@ -463,7 +466,7 @@ static int aac_decode(struct decoder * mpd_decoder, char *path) if (openInputStream(&inStream, path) < 0) return -1; - initAacBuffer(&inStream, &b); + initAacBuffer(&b, mpd_decoder, &inStream); aac_parse_header(&b, NULL); decoder = faacDecOpen(); |