aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputPlugins
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
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 '')
-rw-r--r--src/inputPlugins/_flac_common.c6
-rw-r--r--src/inputPlugins/_flac_common.h5
-rw-r--r--src/inputPlugins/aac_plugin.c8
-rw-r--r--src/inputPlugins/audiofile_plugin.c11
-rw-r--r--src/inputPlugins/flac_plugin.c17
-rw-r--r--src/inputPlugins/mod_plugin.c8
-rw-r--r--src/inputPlugins/mp3_plugin.c22
-rw-r--r--src/inputPlugins/mp4_plugin.c31
-rw-r--r--src/inputPlugins/mpc_plugin.c12
-rw-r--r--src/inputPlugins/oggflac_plugin.c8
-rw-r--r--src/inputPlugins/oggvorbis_plugin.c16
-rw-r--r--src/inputPlugins/wavpack_plugin.c19
12 files changed, 77 insertions, 86 deletions
diff --git a/src/inputPlugins/_flac_common.c b/src/inputPlugins/_flac_common.c
index a26163303..80b1210d1 100644
--- a/src/inputPlugins/_flac_common.c
+++ b/src/inputPlugins/_flac_common.c
@@ -36,13 +36,12 @@
#include <FLAC/format.h>
#include <FLAC/metadata.h>
-void init_FlacData(FlacData * data, OutputBuffer * cb, InputStream * inStream)
+void init_FlacData(FlacData * data, InputStream * inStream)
{
data->chunk_length = 0;
data->time = 0;
data->position = 0;
data->bitRate = 0;
- data->cb = cb;
data->inStream = inStream;
data->replayGainInfo = NULL;
data->tag = NULL;
@@ -171,8 +170,7 @@ void flac_metadata_common_cb(const FLAC__StreamMetadata * block,
dc.audioFormat.sampleRate = si->sample_rate;
dc.audioFormat.channels = (mpd_sint8)si->channels;
dc.totalTime = ((float)si->total_samples) / (si->sample_rate);
- getOutputAudioFormat(&(dc.audioFormat),
- &(data->cb->audioFormat));
+ getOutputAudioFormat(&(dc.audioFormat), &(cb.audioFormat));
break;
case FLAC__METADATA_TYPE_VORBIS_COMMENT:
flacParseReplayGain(block, data);
diff --git a/src/inputPlugins/_flac_common.h b/src/inputPlugins/_flac_common.h
index 37b5fdaae..18e51d587 100644
--- a/src/inputPlugins/_flac_common.h
+++ b/src/inputPlugins/_flac_common.h
@@ -148,14 +148,13 @@ typedef struct {
float time;
unsigned int bitRate;
FLAC__uint64 position;
- OutputBuffer *cb;
InputStream *inStream;
ReplayGainInfo *replayGainInfo;
MpdTag *tag;
} FlacData;
/* initializes a given FlacData struct */
-void init_FlacData(FlacData * data, OutputBuffer * cb, InputStream * inStream);
+void init_FlacData(FlacData * data, InputStream * inStream);
void flac_metadata_common_cb(const FLAC__StreamMetadata * block,
FlacData * data);
void flac_error_common_cb(const char *plugin,
@@ -168,7 +167,7 @@ MpdTag *copyVorbisCommentBlockToMpdTag(const FLAC__StreamMetadata * block,
/* keep this inlined, this is just macro but prettier :) */
static inline int flacSendChunk(FlacData * data)
{
- if (sendDataToOutputBuffer(data->cb, data->inStream,
+ if (sendDataToOutputBuffer(data->inStream,
1, data->chunk,
data->chunk_length, data->time,
data->bitRate,
diff --git a/src/inputPlugins/aac_plugin.c b/src/inputPlugins/aac_plugin.c
index aeda10492..ebf402be1 100644
--- a/src/inputPlugins/aac_plugin.c
+++ b/src/inputPlugins/aac_plugin.c
@@ -282,7 +282,7 @@ static int getAacTotalTime(char *file)
return file_time;
}
-static int aac_decode(OutputBuffer * cb, char *path)
+static int aac_decode(char *path)
{
float file_time;
float totalTime;
@@ -376,7 +376,7 @@ static int aac_decode(OutputBuffer * cb, char *path)
dc.audioFormat.channels = frameInfo.channels;
dc.audioFormat.sampleRate = sampleRate;
getOutputAudioFormat(&(dc.audioFormat),
- &(cb->audioFormat));
+ &(cb.audioFormat));
dc.state = DECODE_STATE_DECODE;
}
@@ -395,7 +395,7 @@ static int aac_decode(OutputBuffer * cb, char *path)
sampleBufferLen = sampleCount * 2;
- sendDataToOutputBuffer(cb, NULL, 0, sampleBuffer,
+ sendDataToOutputBuffer(NULL, 0, sampleBuffer,
sampleBufferLen, file_time,
bitRate, NULL);
if (dc.seek) {
@@ -408,7 +408,7 @@ static int aac_decode(OutputBuffer * cb, char *path)
}
}
- flushOutputBuffer(cb);
+ flushOutputBuffer();
faacDecClose(decoder);
if (b.buffer)
diff --git a/src/inputPlugins/audiofile_plugin.c b/src/inputPlugins/audiofile_plugin.c
index 4510ba46a..d661278b1 100644
--- a/src/inputPlugins/audiofile_plugin.c
+++ b/src/inputPlugins/audiofile_plugin.c
@@ -45,7 +45,7 @@ static int getAudiofileTotalTime(char *file)
return total_time;
}
-static int audiofile_decode(OutputBuffer * cb, char *path)
+static int audiofile_decode(char *path)
{
int fs, frame_count;
AFfilehandle af_fp;
@@ -72,7 +72,7 @@ static int audiofile_decode(OutputBuffer * cb, char *path)
(unsigned int)afGetRate(af_fp, AF_DEFAULT_TRACK);
dc.audioFormat.channels =
(mpd_uint8)afGetVirtualChannels(af_fp, AF_DEFAULT_TRACK);
- getOutputAudioFormat(&(dc.audioFormat), &(cb->audioFormat));
+ getOutputAudioFormat(&(dc.audioFormat), &(cb.audioFormat));
frame_count = afGetFrameCount(af_fp, AF_DEFAULT_TRACK);
@@ -97,7 +97,7 @@ static int audiofile_decode(OutputBuffer * cb, char *path)
while (!eof) {
if (dc.seek) {
- clearOutputBuffer(cb);
+ clearOutputBuffer();
current = dc.seekWhere *
dc.audioFormat.sampleRate;
afSeekFrame(af_fp, AF_DEFAULT_TRACK, current);
@@ -112,8 +112,7 @@ static int audiofile_decode(OutputBuffer * cb, char *path)
eof = 1;
else {
current += ret;
- sendDataToOutputBuffer(cb,
- NULL,
+ sendDataToOutputBuffer(NULL,
1,
chunk,
ret * fs,
@@ -126,7 +125,7 @@ static int audiofile_decode(OutputBuffer * cb, char *path)
}
}
- flushOutputBuffer(cb);
+ flushOutputBuffer();
}
afCloseFile(af_fp);
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)
diff --git a/src/inputPlugins/mod_plugin.c b/src/inputPlugins/mod_plugin.c
index 728f42d6f..31ffa9a3d 100644
--- a/src/inputPlugins/mod_plugin.c
+++ b/src/inputPlugins/mod_plugin.c
@@ -163,7 +163,7 @@ static void mod_close(mod_Data * data)
free(data);
}
-static int mod_decode(OutputBuffer * cb, char *path)
+static int mod_decode(char *path)
{
mod_Data *data;
float total_time = 0.0;
@@ -183,7 +183,7 @@ static int mod_decode(OutputBuffer * cb, char *path)
dc.audioFormat.bits = 16;
dc.audioFormat.sampleRate = 44100;
dc.audioFormat.channels = 2;
- getOutputAudioFormat(&(dc.audioFormat), &(cb->audioFormat));
+ getOutputAudioFormat(&(dc.audioFormat), &(cb.audioFormat));
secPerByte =
1.0 / ((dc.audioFormat.bits * dc.audioFormat.channels / 8.0) *
@@ -205,12 +205,12 @@ static int mod_decode(OutputBuffer * cb, char *path)
ret = VC_WriteBytes(data->audio_buffer, MIKMOD_FRAME_SIZE);
total_time += ret * secPerByte;
- sendDataToOutputBuffer(cb, NULL, 0,
+ sendDataToOutputBuffer(NULL, 0,
(char *)data->audio_buffer, ret,
total_time, 0, NULL);
}
- flushOutputBuffer(cb);
+ flushOutputBuffer();
mod_close(data);
diff --git a/src/inputPlugins/mp3_plugin.c b/src/inputPlugins/mp3_plugin.c
index ea33ad5ad..ee26385d9 100644
--- a/src/inputPlugins/mp3_plugin.c
+++ b/src/inputPlugins/mp3_plugin.c
@@ -813,8 +813,7 @@ static int openMp3FromInputStream(InputStream * inStream, mp3DecodeData * data,
return 0;
}
-static int mp3Read(mp3DecodeData * data, OutputBuffer * cb,
- ReplayGainInfo ** replayGainInfo)
+static int mp3Read(mp3DecodeData * data, ReplayGainInfo ** replayGainInfo)
{
int samplesPerFrame;
int samplesLeft;
@@ -854,7 +853,7 @@ static int mp3Read(mp3DecodeData * data, OutputBuffer * cb,
case MUTEFRAME_SEEK:
if (dc.seekWhere <= data->elapsedTime) {
data->outputPtr = data->outputBuffer;
- clearOutputBuffer(cb);
+ clearOutputBuffer();
data->muteFrame = 0;
dc.seek = 0;
decoder_wakeup_player();
@@ -929,8 +928,7 @@ static int mp3Read(mp3DecodeData * data, OutputBuffer * cb,
}
if (data->outputPtr >= data->outputBufferEnd) {
- ret = sendDataToOutputBuffer(cb,
- data->inStream,
+ ret = sendDataToOutputBuffer(data->inStream,
data->inStream->seekable,
data->outputBuffer,
data->outputPtr - data->outputBuffer,
@@ -965,7 +963,7 @@ static int mp3Read(mp3DecodeData * data, OutputBuffer * cb,
data->frameOffset[j]) ==
0) {
data->outputPtr = data->outputBuffer;
- clearOutputBuffer(cb);
+ clearOutputBuffer();
data->currentFrame = j;
} else
dc.seekError = 1;
@@ -1014,7 +1012,7 @@ static void initAudioFormatFromMp3DecodeData(mp3DecodeData * data,
af->channels = MAD_NCHANNELS(&(data->frame).header);
}
-static int mp3_decode(OutputBuffer * cb, InputStream * inStream)
+static int mp3_decode(InputStream * inStream)
{
mp3DecodeData data;
MpdTag *tag = NULL;
@@ -1031,7 +1029,7 @@ static int mp3_decode(OutputBuffer * cb, InputStream * inStream)
}
initAudioFormatFromMp3DecodeData(&data, &(dc.audioFormat));
- getOutputAudioFormat(&(dc.audioFormat), &(cb->audioFormat));
+ getOutputAudioFormat(&(dc.audioFormat), &(cb.audioFormat));
dc.totalTime = data.totalTime;
@@ -1062,10 +1060,10 @@ static int mp3_decode(OutputBuffer * cb, InputStream * inStream)
dc.state = DECODE_STATE_DECODE;
- while (mp3Read(&data, cb, &replayGainInfo) != DECODE_BREAK) ;
+ while (mp3Read(&data, &replayGainInfo) != DECODE_BREAK) ;
/* send last little bit if not dc.stop */
if (!dc.stop && data.outputPtr != data.outputBuffer && data.flush) {
- sendDataToOutputBuffer(cb, NULL,
+ sendDataToOutputBuffer(NULL,
data.inStream->seekable,
data.outputBuffer,
data.outputPtr - data.outputBuffer,
@@ -1077,12 +1075,12 @@ static int mp3_decode(OutputBuffer * cb, InputStream * inStream)
freeReplayGainInfo(replayGainInfo);
if (dc.seek && data.muteFrame == MUTEFRAME_SEEK) {
- clearOutputBuffer(cb);
+ clearOutputBuffer();
dc.seek = 0;
decoder_wakeup_player();
}
- flushOutputBuffer(cb);
+ flushOutputBuffer();
mp3DecodeDataFinalize(&data);
return 0;
diff --git a/src/inputPlugins/mp4_plugin.c b/src/inputPlugins/mp4_plugin.c
index fb8c71020..1dd418b2d 100644
--- a/src/inputPlugins/mp4_plugin.c
+++ b/src/inputPlugins/mp4_plugin.c
@@ -84,7 +84,7 @@ static uint32_t mp4_inputStreamSeekCallback(void *inStream, uint64_t position)
return seekInputStream((InputStream *) inStream, position, SEEK_SET);
}
-static int mp4_decode(OutputBuffer * cb, InputStream * inStream)
+static int mp4_decode(InputStream * inStream)
{
mp4ff_t *mp4fh;
mp4ff_callback_t *mp4cb;
@@ -217,7 +217,7 @@ static int mp4_decode(OutputBuffer * cb, InputStream * inStream)
if (seeking && seekPositionFound) {
seekPositionFound = 0;
- clearOutputBuffer(cb);
+ clearOutputBuffer();
seeking = 0;
dc.seek = 0;
decoder_wakeup_player();
@@ -255,7 +255,7 @@ static int mp4_decode(OutputBuffer * cb, InputStream * inStream)
dc.audioFormat.sampleRate = scale;
dc.audioFormat.channels = frameInfo.channels;
getOutputAudioFormat(&(dc.audioFormat),
- &(cb->audioFormat));
+ &(cb.audioFormat));
dc.state = DECODE_STATE_DECODE;
}
@@ -277,7 +277,7 @@ static int mp4_decode(OutputBuffer * cb, InputStream * inStream)
sampleBuffer += offset * channels * 2;
- sendDataToOutputBuffer(cb, inStream, 1, sampleBuffer,
+ sendDataToOutputBuffer(inStream, 1, sampleBuffer,
sampleBufferLen, file_time,
bitRate, NULL);
if (dc.stop) {
@@ -295,11 +295,11 @@ static int mp4_decode(OutputBuffer * cb, InputStream * inStream)
return -1;
if (dc.seek && seeking) {
- clearOutputBuffer(cb);
+ clearOutputBuffer();
dc.seek = 0;
decoder_wakeup_player();
}
- flushOutputBuffer(cb);
+ flushOutputBuffer();
return 0;
}
@@ -309,7 +309,7 @@ static MpdTag *mp4DataDup(char *file, int *mp4MetadataFound)
MpdTag *ret = NULL;
InputStream inStream;
mp4ff_t *mp4fh;
- mp4ff_callback_t *cb;
+ mp4ff_callback_t *callback;
int32_t track;
int32_t file_time;
int32_t scale;
@@ -322,14 +322,14 @@ static MpdTag *mp4DataDup(char *file, int *mp4MetadataFound)
return NULL;
}
- cb = xmalloc(sizeof(mp4ff_callback_t));
- cb->read = mp4_inputStreamReadCallback;
- cb->seek = mp4_inputStreamSeekCallback;
- cb->user_data = &inStream;
+ callback = xmalloc(sizeof(mp4ff_callback_t));
+ callback->read = mp4_inputStreamReadCallback;
+ callback->seek = mp4_inputStreamSeekCallback;
+ callback->user_data = &inStream;
- mp4fh = mp4ff_open_read(cb);
+ mp4fh = mp4ff_open_read(callback);
if (!mp4fh) {
- free(cb);
+ free(callback);
closeInputStream(&inStream);
return NULL;
}
@@ -338,7 +338,7 @@ static MpdTag *mp4DataDup(char *file, int *mp4MetadataFound)
if (track < 0) {
mp4ff_close(mp4fh);
closeInputStream(&inStream);
- free(cb);
+ free(callback);
return NULL;
}
@@ -348,7 +348,7 @@ static MpdTag *mp4DataDup(char *file, int *mp4MetadataFound)
if (scale < 0) {
mp4ff_close(mp4fh);
closeInputStream(&inStream);
- free(cb);
+ free(callback);
freeMpdTag(ret);
return NULL;
}
@@ -389,7 +389,6 @@ static MpdTag *mp4DataDup(char *file, int *mp4MetadataFound)
mp4ff_close(mp4fh);
closeInputStream(&inStream);
- free(cb);
return ret;
}
diff --git a/src/inputPlugins/mpc_plugin.c b/src/inputPlugins/mpc_plugin.c
index 867965688..77ca07b30 100644
--- a/src/inputPlugins/mpc_plugin.c
+++ b/src/inputPlugins/mpc_plugin.c
@@ -111,7 +111,7 @@ static inline mpd_sint16 convertSample(MPC_SAMPLE_FORMAT sample)
return val;
}
-static int mpc_decode(OutputBuffer * cb, InputStream * inStream)
+static int mpc_decode(InputStream * inStream)
{
mpc_decoder decoder;
mpc_reader reader;
@@ -170,7 +170,7 @@ static int mpc_decode(OutputBuffer * cb, InputStream * inStream)
dc.audioFormat.channels = info.channels;
dc.audioFormat.sampleRate = info.sample_freq;
- getOutputAudioFormat(&(dc.audioFormat), &(cb->audioFormat));
+ getOutputAudioFormat(&(dc.audioFormat), &(cb.audioFormat));
replayGainInfo = newReplayGainInfo();
replayGainInfo->albumGain = info.gain_album * 0.01;
@@ -184,7 +184,7 @@ static int mpc_decode(OutputBuffer * cb, InputStream * inStream)
if (dc.seek) {
samplePos = dc.seekWhere * dc.audioFormat.sampleRate;
if (mpc_decoder_seek_sample(&decoder, samplePos)) {
- clearOutputBuffer(cb);
+ clearOutputBuffer();
s16 = (mpd_sint16 *) chunk;
chunkpos = 0;
} else
@@ -221,7 +221,7 @@ static int mpc_decode(OutputBuffer * cb, InputStream * inStream)
bitRate = vbrUpdateBits *
dc.audioFormat.sampleRate / 1152 / 1000;
- sendDataToOutputBuffer(cb, inStream,
+ sendDataToOutputBuffer(inStream,
inStream->seekable,
chunk, chunkpos,
total_time,
@@ -243,12 +243,12 @@ static int mpc_decode(OutputBuffer * cb, InputStream * inStream)
bitRate =
vbrUpdateBits * dc.audioFormat.sampleRate / 1152 / 1000;
- sendDataToOutputBuffer(cb, NULL, inStream->seekable,
+ sendDataToOutputBuffer(NULL, inStream->seekable,
chunk, chunkpos, total_time, bitRate,
replayGainInfo);
}
- flushOutputBuffer(cb);
+ flushOutputBuffer();
freeReplayGainInfo(replayGainInfo);
diff --git a/src/inputPlugins/oggflac_plugin.c b/src/inputPlugins/oggflac_plugin.c
index 070404e26..003b057d9 100644
--- a/src/inputPlugins/oggflac_plugin.c
+++ b/src/inputPlugins/oggflac_plugin.c
@@ -336,13 +336,13 @@ static unsigned int oggflac_try_decode(InputStream * inStream)
return (ogg_stream_type_detect(inStream) == FLAC) ? 1 : 0;
}
-static int oggflac_decode(OutputBuffer * cb, InputStream * inStream)
+static int oggflac_decode(InputStream * inStream)
{
OggFLAC__SeekableStreamDecoder *decoder = NULL;
FlacData data;
int ret = 0;
- init_FlacData(&data, cb, inStream);
+ init_FlacData(&data, inStream);
if (!(decoder = full_decoder_init_and_read_metadata(&data, 0))) {
ret = -1;
@@ -362,7 +362,7 @@ static int oggflac_decode(OutputBuffer * cb, InputStream * inStream)
dc.audioFormat.sampleRate + 0.5;
if (OggFLAC__seekable_stream_decoder_seek_absolute
(decoder, sampleToSeek)) {
- clearOutputBuffer(cb);
+ clearOutputBuffer();
data.time = ((float)sampleToSeek) /
dc.audioFormat.sampleRate;
data.position = 0;
@@ -381,7 +381,7 @@ static int oggflac_decode(OutputBuffer * cb, InputStream * inStream)
/* send last little bit */
if (data.chunk_length > 0 && !dc.stop) {
flacSendChunk(&data);
- flushOutputBuffer(data.cb);
+ flushOutputBuffer();
}
fail:
diff --git a/src/inputPlugins/oggvorbis_plugin.c b/src/inputPlugins/oggvorbis_plugin.c
index afcef3e08..eb44b5c6e 100644
--- a/src/inputPlugins/oggvorbis_plugin.c
+++ b/src/inputPlugins/oggvorbis_plugin.c
@@ -195,7 +195,7 @@ static MpdTag *oggCommentsParse(char **comments)
return tag;
}
-static void putOggCommentsIntoOutputBuffer(OutputBuffer * cb, char *streamName,
+static void putOggCommentsIntoOutputBuffer(char *streamName,
char **comments)
{
MpdTag *tag;
@@ -216,7 +216,7 @@ static void putOggCommentsIntoOutputBuffer(OutputBuffer * cb, char *streamName,
}
/* public */
-static int oggvorbis_decode(OutputBuffer * cb, InputStream * inStream)
+static int oggvorbis_decode(InputStream * inStream)
{
OggVorbis_File vf;
ov_callbacks callbacks;
@@ -275,7 +275,7 @@ static int oggvorbis_decode(OutputBuffer * cb, InputStream * inStream)
while (1) {
if (dc.seek) {
if (0 == ov_time_seek_page(&vf, dc.seekWhere)) {
- clearOutputBuffer(cb);
+ clearOutputBuffer();
chunkpos = 0;
} else
dc.seekError = 1;
@@ -292,11 +292,11 @@ static int oggvorbis_decode(OutputBuffer * cb, InputStream * inStream)
dc.audioFormat.sampleRate = vi->rate;
if (dc.state == DECODE_STATE_START) {
getOutputAudioFormat(&(dc.audioFormat),
- &(cb->audioFormat));
+ &(cb.audioFormat));
dc.state = DECODE_STATE_DECODE;
}
comments = ov_comment(&vf, -1)->user_comments;
- putOggCommentsIntoOutputBuffer(cb, inStream->metaName,
+ putOggCommentsIntoOutputBuffer(inStream->metaName,
comments);
ogg_getReplayGainInfo(comments, &replayGainInfo);
}
@@ -316,7 +316,7 @@ static int oggvorbis_decode(OutputBuffer * cb, InputStream * inStream)
if ((test = ov_bitrate_instant(&vf)) > 0) {
bitRate = test / 1000;
}
- sendDataToOutputBuffer(cb, inStream,
+ sendDataToOutputBuffer(inStream,
inStream->seekable,
chunk, chunkpos,
ov_pcm_tell(&vf) /
@@ -329,7 +329,7 @@ static int oggvorbis_decode(OutputBuffer * cb, InputStream * inStream)
}
if (!dc.stop && chunkpos > 0) {
- sendDataToOutputBuffer(cb, NULL, inStream->seekable,
+ sendDataToOutputBuffer(NULL, inStream->seekable,
chunk, chunkpos,
ov_time_tell(&vf), bitRate,
replayGainInfo);
@@ -340,7 +340,7 @@ static int oggvorbis_decode(OutputBuffer * cb, InputStream * inStream)
ov_clear(&vf);
- flushOutputBuffer(cb);
+ flushOutputBuffer();
return 0;
}
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);