diff options
author | Max Kellermann <max@duempel.org> | 2009-07-06 21:50:13 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-07-06 21:50:13 +0200 |
commit | 13e725ab0927aed210c599bdd6e6a285285c3476 (patch) | |
tree | db5dc2975d9ed352bebe39453c148ace3fa70341 /src/output_init.c | |
parent | f5c2acf1d437eac0c3eedfbb30cfa453a753294c (diff) | |
download | mpd-13e725ab0927aed210c599bdd6e6a285285c3476.tar.gz mpd-13e725ab0927aed210c599bdd6e6a285285c3476.tar.xz mpd-13e725ab0927aed210c599bdd6e6a285285c3476.zip |
output_init: merge two local string variables
Diffstat (limited to '')
-rw-r--r-- | src/output_init.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/output_init.c b/src/output_init.c index 238ca8081..2b227a130 100644 --- a/src/output_init.c +++ b/src/output_init.c @@ -81,21 +81,19 @@ audio_output_init(struct audio_output *ao, const struct config_param *param, const struct audio_output_plugin *plugin = NULL; if (param) { - const char *type = NULL; - const char *format; + const char *p; - type = config_get_block_string(param, AUDIO_OUTPUT_TYPE, NULL); - if (type == NULL) { + p = config_get_block_string(param, AUDIO_OUTPUT_TYPE, NULL); + if (p == NULL) { g_set_error(error, audio_output_quark(), 0, "Missing \"type\" configuration"); return false; } - plugin = audio_output_plugin_get(type); + plugin = audio_output_plugin_get(p); if (plugin == NULL) { g_set_error(error, audio_output_quark(), 0, - "No such audio output plugin: %s", - type); + "No such audio output plugin: %s", p); return false; } @@ -107,13 +105,13 @@ audio_output_init(struct audio_output *ao, const struct config_param *param, return false; } - format = config_get_block_string(param, AUDIO_OUTPUT_FORMAT, + p = config_get_block_string(param, AUDIO_OUTPUT_FORMAT, NULL); - ao->config_audio_format = format != NULL; - if (format != NULL) { + ao->config_audio_format = p != NULL; + if (p != NULL) { bool success = audio_format_parse(&ao->out_audio_format, - format, error); + p, error); if (!success) return false; } |