aboutsummaryrefslogtreecommitdiffstats
path: root/src/output_thread.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-10-21 23:01:04 +0200
committerMax Kellermann <max@duempel.org>2009-10-21 23:01:04 +0200
commit9526fdbe730edb4b095a1e12aade0e16f1da2292 (patch)
tree4544e77bf35e08a12d2b019e0bf3942754b85b96 /src/output_thread.c
parenta5c4566fa1551953b84882a1fa53400c7bd6551c (diff)
downloadmpd-9526fdbe730edb4b095a1e12aade0e16f1da2292.tar.gz
mpd-9526fdbe730edb4b095a1e12aade0e16f1da2292.tar.xz
mpd-9526fdbe730edb4b095a1e12aade0e16f1da2292.zip
audio_format: wildcards allowed in audio_format configuration
An asterisk means that this attribute should not be enforced, and stays whatever it used to be. This way, some configuration values work like masks.
Diffstat (limited to 'src/output_thread.c')
-rw-r--r--src/output_thread.c11
1 files changed, 6 insertions, 5 deletions
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)