diff options
author | Max Kellermann <max@duempel.org> | 2014-02-19 23:59:17 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-02-20 00:04:23 +0100 |
commit | 9e0ce23a03096a9a2e3ac2936ca64b8ea1fdd326 (patch) | |
tree | 18da64dc44908132caad4792dffb78e6bbab0e8c /test/run_output.cxx | |
parent | 04ba433ca631f0c3f51b067a6b55dc1046bd287e (diff) | |
download | mpd-9e0ce23a03096a9a2e3ac2936ca64b8ea1fdd326.tar.gz mpd-9e0ce23a03096a9a2e3ac2936ca64b8ea1fdd326.tar.xz mpd-9e0ce23a03096a9a2e3ac2936ca64b8ea1fdd326.zip |
test/run_{filter,output}: use config_find_block()
Diffstat (limited to 'test/run_output.cxx')
-rw-r--r-- | test/run_output.cxx | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/test/run_output.cxx b/test/run_output.cxx index 8aac5e555..fca5146df 100644 --- a/test/run_output.cxx +++ b/test/run_output.cxx @@ -53,20 +53,6 @@ filter_plugin_by_name(gcc_unused const char *name) return NULL; } -static const struct config_param * -find_named_config_block(ConfigOption option, const char *name) -{ - const struct config_param *param = NULL; - - while ((param = config_get_next_param(option, param)) != NULL) { - const char *current_name = param->GetBlockValue("name"); - if (current_name != NULL && strcmp(current_name, name) == 0) - return param; - } - - return NULL; -} - PlayerControl::PlayerControl(gcc_unused MultipleOutputs &_outputs, gcc_unused unsigned _buffer_chunks, gcc_unused unsigned _buffered_before_play) @@ -76,9 +62,8 @@ PlayerControl::~PlayerControl() {} static AudioOutput * load_audio_output(EventLoop &event_loop, const char *name) { - const struct config_param *param; - - param = find_named_config_block(CONF_AUDIO_OUTPUT, name); + const config_param *param = + config_find_block(CONF_AUDIO_OUTPUT, "name", name); if (param == NULL) { fprintf(stderr, "No such configured audio output: %s\n", name); return nullptr; |