From 3cae6856b8c6096b3f932a4ab30476a8d1187e58 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 24 Sep 2008 07:20:36 +0200 Subject: output: pass audio_format to plugin.init() and plugin.open() Pass the globally configured audio_format as a const pointer to plugin.init(). plugin.open() gets a writable pointer which contains the audio_format requested by the plugin. Its initial value is either the configured audio_format or the input file's audio_format. --- src/audioOutputs/audioOutput_shout.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/audioOutputs/audioOutput_shout.c') diff --git a/src/audioOutputs/audioOutput_shout.c b/src/audioOutputs/audioOutput_shout.c index 61657b0aa..835b6022d 100644 --- a/src/audioOutputs/audioOutput_shout.c +++ b/src/audioOutputs/audioOutput_shout.c @@ -88,6 +88,7 @@ static void free_shout_data(struct shout_data *sd) } static int my_shout_init_driver(struct audio_output *audio_output, + const struct audio_format *audio_format, ConfigParam * param) { struct shout_data *sd; @@ -177,7 +178,9 @@ static int my_shout_init_driver(struct audio_output *audio_output, } check_block_param("format"); - sd->audio_format = audio_output->reqAudioFormat; + + assert(audio_format != NULL); + sd->audio_format = *audio_format; block_param = getBlockParam(param, "encoding"); if (block_param) { @@ -439,7 +442,8 @@ static int open_shout_conn(struct audio_output *audio_output) return 0; } -static int my_shout_open_device(struct audio_output *audio_output) +static int my_shout_open_device(struct audio_output *audio_output, + struct audio_format *audio_format) { struct shout_data *sd = (struct shout_data *) audio_output->data; @@ -449,7 +453,7 @@ static int my_shout_open_device(struct audio_output *audio_output) if (sd->timer) timer_free(sd->timer); - sd->timer = timer_new(&audio_output->outAudioFormat); + sd->timer = timer_new(audio_format); audio_output->open = 1; -- cgit v1.2.3