diff options
Diffstat (limited to '')
-rw-r--r-- | src/output/shout_plugin.c | 9 | ||||
-rw-r--r-- | src/output_init.c | 5 | ||||
-rw-r--r-- | src/output_thread.c | 11 |
3 files changed, 15 insertions, 10 deletions
diff --git a/src/output/shout_plugin.c b/src/output/shout_plugin.c index f1b21bb36..da90efd2d 100644 --- a/src/output/shout_plugin.c +++ b/src/output/shout_plugin.c @@ -126,6 +126,13 @@ my_shout_init_driver(const struct audio_format *audio_format, struct block_param *block_param; int public; + if (audio_format == NULL || + !audio_format_fully_defined(audio_format)) { + g_set_error(error, shout_output_quark(), 0, + "Need full audio format specification"); + return NULL; + } + sd = new_shout_data(); if (shout_init_count == 0) @@ -191,8 +198,6 @@ my_shout_init_driver(const struct audio_format *audio_format, } } - check_block_param("format"); - encoding = config_get_block_string(param, "encoding", "ogg"); encoder_plugin = shout_encoder_plugin_get(encoding); if (encoder_plugin == NULL) { diff --git a/src/output_init.c b/src/output_init.c index f097f2c2d..745b63e30 100644 --- a/src/output_init.c +++ b/src/output_init.c @@ -157,7 +157,7 @@ audio_output_init(struct audio_output *ao, const struct config_param *param, if (p != NULL) { bool success = audio_format_parse(&ao->config_audio_format, - p, error_r); + p, true, error_r); if (!success) return false; } else @@ -195,8 +195,7 @@ audio_output_init(struct audio_output *ao, const struct config_param *param, ao->mutex = g_mutex_new(); ao->data = ao_plugin_init(plugin, - audio_format_defined(&ao->config_audio_format) - ? &ao->config_audio_format : NULL, + &ao->config_audio_format, param, error_r); if (ao->data == NULL) return false; diff --git a/src/output_thread.c b/src/output_thread.c index dd97d88b0..9eb2478b0 100644 --- a/src/output_thread.c +++ b/src/output_thread.c @@ -67,10 +67,9 @@ ao_open(struct audio_output *ao) return; } - if (audio_format_defined(&ao->config_audio_format)) - ao->out_audio_format = ao->config_audio_format; - else - ao->out_audio_format = *filter_audio_format; + ao->out_audio_format = *filter_audio_format; + audio_format_mask_apply(&ao->out_audio_format, + &ao->config_audio_format); success = ao_plugin_open(ao->plugin, ao->data, &ao->out_audio_format, @@ -166,7 +165,7 @@ ao_reopen_filter(struct audio_output *ao) static void ao_reopen(struct audio_output *ao) { - if (!audio_format_defined(&ao->config_audio_format)) { + if (!audio_format_fully_defined(&ao->config_audio_format)) { if (ao->open) { const struct music_pipe *mp = ao->pipe; ao_close(ao); @@ -177,6 +176,8 @@ ao_reopen(struct audio_output *ao) the output's open() method determine the effective out_audio_format */ ao->out_audio_format = ao->in_audio_format; + audio_format_mask_apply(&ao->out_audio_format, + &ao->config_audio_format); } if (ao->open) |