diff options
author | Max Kellermann <max@duempel.org> | 2009-03-20 15:47:50 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-03-20 15:47:50 +0100 |
commit | e6c753a474bcf1d81127f74762f8b7f913dd3160 (patch) | |
tree | 37bce87b2de1f2ee7d40c28074a53c423c7a6789 /src/output_init.c | |
parent | 67e65a7959be0e3dee2fd2023a2c23217c50c1d8 (diff) | |
download | mpd-e6c753a474bcf1d81127f74762f8b7f913dd3160.tar.gz mpd-e6c753a474bcf1d81127f74762f8b7f913dd3160.tar.xz mpd-e6c753a474bcf1d81127f74762f8b7f913dd3160.zip |
output: convert audio_output.config_audio_format to boolean
The config_audio_format used to contain the configured audio format,
which is copied to out_audio_format. Let's convert the former to a
boolean, which indicates whether out_audio_format was already set.
This simplifies some code and saves a few bytes.
Diffstat (limited to '')
-rw-r--r-- | src/output_init.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/output_init.c b/src/output_init.c index 7f7ad353d..f837ba8b8 100644 --- a/src/output_init.c +++ b/src/output_init.c @@ -112,15 +112,15 @@ audio_output_init(struct audio_output *ao, const struct config_param *param, pcm_convert_init(&ao->convert_state); - if (format) { + ao->config_audio_format = format != NULL; + if (ao->config_audio_format) { bool ret; - ret = audio_format_parse(&ao->config_audio_format, format, + ret = audio_format_parse(&ao->out_audio_format, format, error); if (!ret) return false; - } else - audio_format_clear(&ao->config_audio_format); + } ao->thread = NULL; notify_init(&ao->notify); @@ -128,7 +128,8 @@ audio_output_init(struct audio_output *ao, const struct config_param *param, ao->mutex = g_mutex_new(); ao->data = ao_plugin_init(plugin, - format ? &ao->config_audio_format : NULL, + ao->config_audio_format + ? &ao->out_audio_format : NULL, param, error); if (ao->data == NULL) return false; |