aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputPlugins/flac_plugin.c
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2008-04-13 01:16:15 +0000
committerEric Wong <normalperson@yhbt.net>2008-04-13 01:16:15 +0000
commitc1963ed483c66e85ac19ce8c3a6dbc6b19ca30c3 (patch)
treeb8c2ff14310e1e659f509aeae0cf847608af2d5f /src/inputPlugins/flac_plugin.c
parentdec6b1612e953c6029d963ff55d2b4a669b60f43 (diff)
downloadmpd-c1963ed483c66e85ac19ce8c3a6dbc6b19ca30c3.tar.gz
mpd-c1963ed483c66e85ac19ce8c3a6dbc6b19ca30c3.tar.xz
mpd-c1963ed483c66e85ac19ce8c3a6dbc6b19ca30c3.zip
Stop passing our single OutputBuffer object everywhere
All of our main singleton data structures are implicitly shared, so there's no reason to keep passing them around and around in the stack and making our internal API harder to deal with. git-svn-id: https://svn.musicpd.org/mpd/trunk@7354 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/inputPlugins/flac_plugin.c')
-rw-r--r--src/inputPlugins/flac_plugin.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/inputPlugins/flac_plugin.c b/src/inputPlugins/flac_plugin.c
index f171ee457..70b5c7a80 100644
--- a/src/inputPlugins/flac_plugin.c
+++ b/src/inputPlugins/flac_plugin.c
@@ -381,8 +381,7 @@ static MpdTag *flacTagDup(char *file)
return ret;
}
-static int flac_decode_internal(OutputBuffer * cb,
- InputStream * inStream, int is_ogg)
+static int flac_decode_internal(InputStream * inStream, int is_ogg)
{
flac_decoder *flacDec;
FlacData data;
@@ -390,7 +389,7 @@ static int flac_decode_internal(OutputBuffer * cb,
if (!(flacDec = flac_new()))
return -1;
- init_FlacData(&data, cb, inStream);
+ init_FlacData(&data, 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))
@@ -431,7 +430,7 @@ static int flac_decode_internal(OutputBuffer * cb,
FLAC__uint64 sampleToSeek = dc.seekWhere *
dc.audioFormat.sampleRate + 0.5;
if (flac_seek_absolute(flacDec, sampleToSeek)) {
- clearOutputBuffer(cb);
+ clearOutputBuffer();
data.time = ((float)sampleToSeek) /
dc.audioFormat.sampleRate;
data.position = 0;
@@ -448,7 +447,7 @@ static int flac_decode_internal(OutputBuffer * cb,
/* send last little bit */
if (data.chunk_length > 0 && !dc.stop) {
flacSendChunk(&data);
- flushOutputBuffer(data.cb);
+ flushOutputBuffer();
}
fail:
@@ -465,9 +464,9 @@ fail:
return 0;
}
-static int flac_decode(OutputBuffer * cb, InputStream * inStream)
+static int flac_decode(InputStream * inStream)
{
- return flac_decode_internal(cb, inStream, 0);
+ return flac_decode_internal(inStream, 0);
}
#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT <= 7
@@ -506,9 +505,9 @@ out:
return ret;
}
-static int oggflac_decode(OutputBuffer * cb, InputStream * inStream)
+static int oggflac_decode(InputStream * inStream)
{
- return flac_decode_internal(cb, inStream, 1);
+ return flac_decode_internal(inStream, 1);
}
static unsigned int oggflac_try_decode(InputStream * inStream)