aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/run_filter.cxx19
-rw-r--r--test/run_output.cxx19
2 files changed, 4 insertions, 34 deletions
diff --git a/test/run_filter.cxx b/test/run_filter.cxx
index c43144a10..1bde583a4 100644
--- a/test/run_filter.cxx
+++ b/test/run_filter.cxx
@@ -50,26 +50,11 @@ mixer_set_volume(gcc_unused Mixer *mixer,
return true;
}
-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;
-}
-
static Filter *
load_filter(const char *name)
{
- const struct config_param *param;
-
- param = find_named_config_block(CONF_AUDIO_FILTER, name);
+ const config_param *param =
+ config_find_block(CONF_AUDIO_FILTER, "name", name);
if (param == NULL) {
fprintf(stderr, "No such configured filter: %s\n", name);
return nullptr;
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;