diff options
author | Max Kellermann <max@duempel.org> | 2008-09-24 07:20:36 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-09-24 07:20:36 +0200 |
commit | 3cae6856b8c6096b3f932a4ab30476a8d1187e58 (patch) | |
tree | ce4a7dfea71105b723779b08d37108ec3f258bdd /src/audioOutputs/audioOutput_shout.c | |
parent | d32f49a90ba69525884ee6fe4f2055792aa10430 (diff) | |
download | mpd-3cae6856b8c6096b3f932a4ab30476a8d1187e58.tar.gz mpd-3cae6856b8c6096b3f932a4ab30476a8d1187e58.tar.xz mpd-3cae6856b8c6096b3f932a4ab30476a8d1187e58.zip |
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.
Diffstat (limited to 'src/audioOutputs/audioOutput_shout.c')
-rw-r--r-- | src/audioOutputs/audioOutput_shout.c | 10 |
1 files changed, 7 insertions, 3 deletions
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; |