diff options
author | Max Kellermann <max@duempel.org> | 2013-08-04 12:25:08 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-08-04 14:07:49 +0200 |
commit | 81c3224076da6ad727debc6bab8a5422f7322451 (patch) | |
tree | 1da1912caa6c7ff863f7affeafae22e9e6004e8f /src/OutputAll.cxx | |
parent | 7a1d466fb279659048e80e2853a7906c90d73235 (diff) | |
download | mpd-81c3224076da6ad727debc6bab8a5422f7322451.tar.gz mpd-81c3224076da6ad727debc6bab8a5422f7322451.tar.xz mpd-81c3224076da6ad727debc6bab8a5422f7322451.zip |
OutputPlugin: pass config_param reference
Diffstat (limited to 'src/OutputAll.cxx')
-rw-r--r-- | src/OutputAll.cxx | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/OutputAll.cxx b/src/OutputAll.cxx index a73afbbb6..2e721efa3 100644 --- a/src/OutputAll.cxx +++ b/src/OutputAll.cxx @@ -109,16 +109,23 @@ audio_output_all_init(struct player_control *pc) num_audio_outputs = audio_output_config_count(); audio_outputs = g_new(struct audio_output *, num_audio_outputs); + const config_param empty; + for (i = 0; i < num_audio_outputs; i++) { unsigned int j; param = config_get_next_param(CONF_AUDIO_OUTPUT, param); + if (param == nullptr) { + /* only allow param to be nullptr if there + just one audio output */ + assert(i == 0); + assert(num_audio_outputs == 1); - /* only allow param to be NULL if there just one audioOutput */ - assert(param || (num_audio_outputs == 1)); + param = ∅ + } - struct audio_output *output = audio_output_new(param, pc, &error); + struct audio_output *output = audio_output_new(*param, pc, &error); if (output == NULL) { if (param != NULL) MPD_ERROR("line %i: %s", |