aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputPlugins/mod_plugin.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/mod_plugin.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/mod_plugin.c')
-rw-r--r--src/inputPlugins/mod_plugin.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/inputPlugins/mod_plugin.c b/src/inputPlugins/mod_plugin.c
index 25cedf04b..728f42d6f 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, DecoderControl * dc, char *path)
+static int mod_decode(OutputBuffer * cb, char *path)
{
mod_Data *data;
float total_time = 0.0;
@@ -179,25 +179,25 @@ static int mod_decode(OutputBuffer * cb, DecoderControl * dc, char *path)
return -1;
}
- dc->totalTime = 0;
- dc->audioFormat.bits = 16;
- dc->audioFormat.sampleRate = 44100;
- dc->audioFormat.channels = 2;
- getOutputAudioFormat(&(dc->audioFormat), &(cb->audioFormat));
+ dc.totalTime = 0;
+ dc.audioFormat.bits = 16;
+ dc.audioFormat.sampleRate = 44100;
+ dc.audioFormat.channels = 2;
+ getOutputAudioFormat(&(dc.audioFormat), &(cb->audioFormat));
secPerByte =
- 1.0 / ((dc->audioFormat.bits * dc->audioFormat.channels / 8.0) *
- (float)dc->audioFormat.sampleRate);
+ 1.0 / ((dc.audioFormat.bits * dc.audioFormat.channels / 8.0) *
+ (float)dc.audioFormat.sampleRate);
- dc->state = DECODE_STATE_DECODE;
+ dc.state = DECODE_STATE_DECODE;
while (1) {
- if (dc->seek) {
- dc->seekError = 1;
- dc->seek = 0;
+ if (dc.seek) {
+ dc.seekError = 1;
+ dc.seek = 0;
decoder_wakeup_player();
}
- if (dc->stop)
+ if (dc.stop)
break;
if (!Player_Active())
@@ -205,7 +205,7 @@ static int mod_decode(OutputBuffer * cb, DecoderControl * dc, char *path)
ret = VC_WriteBytes(data->audio_buffer, MIKMOD_FRAME_SIZE);
total_time += ret * secPerByte;
- sendDataToOutputBuffer(cb, NULL, dc, 0,
+ sendDataToOutputBuffer(cb, NULL, 0,
(char *)data->audio_buffer, ret,
total_time, 0, NULL);
}