aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputPlugins/flac_plugin.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-08-26 08:27:04 +0200
committerMax Kellermann <max@duempel.org>2008-08-26 08:27:04 +0200
commit154aa496e8c18bba3dc10c607987c187f4686ae4 (patch)
tree32a2a35f74e823c5eea21bbfbebef1297fe6e989 /src/inputPlugins/flac_plugin.c
parent241cd043ca4f9dd560e6d947a9bf025f58de4ea9 (diff)
downloadmpd-154aa496e8c18bba3dc10c607987c187f4686ae4.tar.gz
mpd-154aa496e8c18bba3dc10c607987c187f4686ae4.tar.xz
mpd-154aa496e8c18bba3dc10c607987c187f4686ae4.zip
added struct decoder
The decoder struct should later be made opaque to the decoder plugin, because maintaining a stable struct ABI is quite difficult. The ABI should only consist of a small number of stable functions.
Diffstat (limited to 'src/inputPlugins/flac_plugin.c')
-rw-r--r--src/inputPlugins/flac_plugin.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/inputPlugins/flac_plugin.c b/src/inputPlugins/flac_plugin.c
index a5b44c7f4..7c4b8e356 100644
--- a/src/inputPlugins/flac_plugin.c
+++ b/src/inputPlugins/flac_plugin.c
@@ -376,7 +376,8 @@ static MpdTag *flacTagDup(char *file)
return ret;
}
-static int flac_decode_internal(InputStream * inStream, int is_ogg)
+static int flac_decode_internal(struct decoder * decoder,
+ InputStream * inStream, int is_ogg)
{
flac_decoder *flacDec;
FlacData data;
@@ -384,7 +385,7 @@ static int flac_decode_internal(InputStream * inStream, int is_ogg)
if (!(flacDec = flac_new()))
return -1;
- init_FlacData(&data, inStream);
+ init_FlacData(&data, decoder, inStream);
#if defined(FLAC_API_VERSION_CURRENT) && FLAC_API_VERSION_CURRENT > 7
if(!FLAC__stream_decoder_set_metadata_respond(flacDec, FLAC__METADATA_TYPE_VORBIS_COMMENT))
@@ -458,9 +459,9 @@ fail:
return 0;
}
-static int flac_decode(InputStream * inStream)
+static int flac_decode(struct decoder * decoder, InputStream * inStream)
{
- return flac_decode_internal(inStream, 0);
+ return flac_decode_internal(decoder, inStream, 0);
}
#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT <= 7
@@ -499,9 +500,9 @@ out:
return ret;
}
-static int oggflac_decode(InputStream * inStream)
+static int oggflac_decode(struct decoder *decoder, InputStream * inStream)
{
- return flac_decode_internal(inStream, 1);
+ return flac_decode_internal(decoder, inStream, 1);
}
static unsigned int oggflac_try_decode(InputStream * inStream)