aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputPlugins/wavpack_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/wavpack_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/wavpack_plugin.c')
-rw-r--r--src/inputPlugins/wavpack_plugin.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/inputPlugins/wavpack_plugin.c b/src/inputPlugins/wavpack_plugin.c
index bae5f6acb..13f10a1e9 100644
--- a/src/inputPlugins/wavpack_plugin.c
+++ b/src/inputPlugins/wavpack_plugin.c
@@ -128,8 +128,7 @@ static void format_samples_float(int Bps, void *buffer, uint32_t samcnt)
* This does the main decoding thing.
* Requires an already opened WavpackContext.
*/
-static void wavpack_decode(OutputBuffer *cb,
- WavpackContext *wpc, int canseek,
+static void wavpack_decode(WavpackContext *wpc, int canseek,
ReplayGainInfo *replayGainInfo)
{
void (*format_samples)(int Bps, void *buffer, uint32_t samcnt);
@@ -167,7 +166,7 @@ static void wavpack_decode(OutputBuffer *cb,
samplesreq = sizeof(chunk) / (4 * dc.audioFormat.channels);
- getOutputAudioFormat(&(dc.audioFormat), &(cb->audioFormat));
+ getOutputAudioFormat(&(dc.audioFormat), &(cb.audioFormat));
dc.totalTime = (float)allsamples / dc.audioFormat.sampleRate;
dc.state = DECODE_STATE_DECODE;
@@ -180,7 +179,7 @@ static void wavpack_decode(OutputBuffer *cb,
if (canseek) {
int where;
- clearOutputBuffer(cb);
+ clearOutputBuffer();
where = dc.seekWhere *
dc.audioFormat.sampleRate;
@@ -211,14 +210,14 @@ static void wavpack_decode(OutputBuffer *cb,
format_samples(Bps, chunk,
samplesgot * dc.audioFormat.channels);
- sendDataToOutputBuffer(cb, NULL, 0, chunk,
+ sendDataToOutputBuffer(NULL, 0, chunk,
samplesgot * outsamplesize,
file_time, bitrate,
replayGainInfo);
}
} while (samplesgot == samplesreq);
- flushOutputBuffer(cb);
+ flushOutputBuffer();
}
static char *wavpack_tag(WavpackContext *wpc, char *key)
@@ -442,7 +441,7 @@ static unsigned int wavpack_trydecode(InputStream *is)
/*
* Decodes a stream.
*/
-static int wavpack_streamdecode(OutputBuffer *cb, InputStream *is)
+static int wavpack_streamdecode(InputStream *is)
{
char error[ERRORLEN];
WavpackContext *wpc;
@@ -541,7 +540,7 @@ static int wavpack_streamdecode(OutputBuffer *cb, InputStream *is)
return -1;
}
- wavpack_decode(cb, wpc, canseek, NULL);
+ wavpack_decode(wpc, canseek, NULL);
WavpackCloseFile(wpc);
if (wvc_url != NULL) {
@@ -556,7 +555,7 @@ static int wavpack_streamdecode(OutputBuffer *cb, InputStream *is)
/*
* Decodes a file.
*/
-static int wavpack_filedecode(OutputBuffer *cb, char *fname)
+static int wavpack_filedecode(char *fname)
{
char error[ERRORLEN];
WavpackContext *wpc;
@@ -572,7 +571,7 @@ static int wavpack_filedecode(OutputBuffer *cb, char *fname)
replayGainInfo = wavpack_replaygain(wpc);
- wavpack_decode(cb, wpc, 1, replayGainInfo);
+ wavpack_decode(wpc, 1, replayGainInfo);
if (replayGainInfo)
freeReplayGainInfo(replayGainInfo);