aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputPlugins/_flac_common.c
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2008-04-13 01:16:03 +0000
committerEric Wong <normalperson@yhbt.net>2008-04-13 01:16:03 +0000
commitdec6b1612e953c6029d963ff55d2b4a669b60f43 (patch)
treea1138cb07f67c821ee5000618302d21367ab2245 /src/inputPlugins/_flac_common.c
parent98acfa8ac5bac09ca49a7c21938b5a5801e01ca5 (diff)
downloadmpd-dec6b1612e953c6029d963ff55d2b4a669b60f43.tar.gz
mpd-dec6b1612e953c6029d963ff55d2b4a669b60f43.tar.xz
mpd-dec6b1612e953c6029d963ff55d2b4a669b60f43.zip
Stop passing our single DecoderControl object everywhere
This at least makes the argument list to a lot of our plugin functions shorter and removes a good amount of line nois^W^Wcode, hopefully making things easier to read and follow. git-svn-id: https://svn.musicpd.org/mpd/trunk@7353 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/inputPlugins/_flac_common.c')
-rw-r--r--src/inputPlugins/_flac_common.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/inputPlugins/_flac_common.c b/src/inputPlugins/_flac_common.c
index 3b351d3a7..a26163303 100644
--- a/src/inputPlugins/_flac_common.c
+++ b/src/inputPlugins/_flac_common.c
@@ -36,15 +36,13 @@
#include <FLAC/format.h>
#include <FLAC/metadata.h>
-void init_FlacData(FlacData * data, OutputBuffer * cb,
- DecoderControl * dc, InputStream * inStream)
+void init_FlacData(FlacData * data, OutputBuffer * cb, InputStream * inStream)
{
data->chunk_length = 0;
data->time = 0;
data->position = 0;
data->bitRate = 0;
data->cb = cb;
- data->dc = dc;
data->inStream = inStream;
data->replayGainInfo = NULL;
data->tag = NULL;
@@ -165,16 +163,15 @@ MpdTag *copyVorbisCommentBlockToMpdTag(const FLAC__StreamMetadata * block,
void flac_metadata_common_cb(const FLAC__StreamMetadata * block,
FlacData * data)
{
- DecoderControl *dc = data->dc;
const FLAC__StreamMetadata_StreamInfo *si = &(block->data.stream_info);
switch (block->type) {
case FLAC__METADATA_TYPE_STREAMINFO:
- dc->audioFormat.bits = (mpd_sint8)si->bits_per_sample;
- 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),
+ dc.audioFormat.bits = (mpd_sint8)si->bits_per_sample;
+ 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));
break;
case FLAC__METADATA_TYPE_VORBIS_COMMENT:
@@ -188,7 +185,7 @@ void flac_error_common_cb(const char *plugin,
const FLAC__StreamDecoderErrorStatus status,
FlacData * data)
{
- if (data->dc->stop)
+ if (dc.stop)
return;
switch (status) {