aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputPlugins/mod_plugin.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-08-26 08:27:05 +0200
committerMax Kellermann <max@duempel.org>2008-08-26 08:27:05 +0200
commit4590a98f0eb9484e185e7e0c25a3373c8e9076ea (patch)
tree94ea0d53bdf0b7f9b81ff679b0fb4466d971b1e5 /src/inputPlugins/mod_plugin.c
parent0d45870cea6836cd48e6953f4e67756b2502e22c (diff)
downloadmpd-4590a98f0eb9484e185e7e0c25a3373c8e9076ea.tar.gz
mpd-4590a98f0eb9484e185e7e0c25a3373c8e9076ea.tar.xz
mpd-4590a98f0eb9484e185e7e0c25a3373c8e9076ea.zip
added audio_format parameter to decoder_initialized()
dc->audioFormat is set once by the decoder plugins before invoking decoder_initialized(); hide dc->audioFormat and let the decoder pass an AudioFormat pointer to decoder_initialized().
Diffstat (limited to 'src/inputPlugins/mod_plugin.c')
-rw-r--r--src/inputPlugins/mod_plugin.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/inputPlugins/mod_plugin.c b/src/inputPlugins/mod_plugin.c
index 930b041e9..4ab1338bf 100644
--- a/src/inputPlugins/mod_plugin.c
+++ b/src/inputPlugins/mod_plugin.c
@@ -162,6 +162,7 @@ static void mod_close(mod_Data * data)
static int mod_decode(struct decoder * decoder, char *path)
{
mod_Data *data;
+ AudioFormat audio_format;
float total_time = 0.0;
int ret;
float secPerByte;
@@ -176,16 +177,16 @@ static int mod_decode(struct decoder * decoder, char *path)
}
dc.totalTime = 0;
- dc.audioFormat.bits = 16;
- dc.audioFormat.sampleRate = 44100;
- dc.audioFormat.channels = 2;
- getOutputAudioFormat(&(dc.audioFormat), &(ob.audioFormat));
+ audio_format.bits = 16;
+ audio_format.sampleRate = 44100;
+ audio_format.channels = 2;
secPerByte =
- 1.0 / ((dc.audioFormat.bits * dc.audioFormat.channels / 8.0) *
- (float)dc.audioFormat.sampleRate);
+ 1.0 / ((audio_format.bits * audio_format.channels / 8.0) *
+ (float)audio_format.sampleRate);
+
+ decoder_initialized(decoder, &audio_format);
- decoder_initialized(decoder);
while (1) {
if (dc.command == DECODE_COMMAND_SEEK) {
dc.seekError = 1;