diff options
author | Max Kellermann <max@duempel.org> | 2013-08-04 11:30:26 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-08-04 13:30:47 +0200 |
commit | 7a1d466fb279659048e80e2853a7906c90d73235 (patch) | |
tree | f0c73e11b86b584a1a3f230507eabcf6f02986ea /src/DecoderList.cxx | |
parent | 83f4c48c8aaa46bbede4447c95939af310ea28ad (diff) | |
download | mpd-7a1d466fb279659048e80e2853a7906c90d73235.tar.gz mpd-7a1d466fb279659048e80e2853a7906c90d73235.tar.xz mpd-7a1d466fb279659048e80e2853a7906c90d73235.zip |
DecoderPlugin: pass config_param reference
Diffstat (limited to 'src/DecoderList.cxx')
-rw-r--r-- | src/DecoderList.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/DecoderList.cxx b/src/DecoderList.cxx index 0827586db..5c1a486df 100644 --- a/src/DecoderList.cxx +++ b/src/DecoderList.cxx @@ -201,8 +201,7 @@ decoder_plugin_config(const char *plugin_name) const struct config_param *param = NULL; while ((param = config_get_next_param(CONF_DECODER, param)) != NULL) { - const char *name = - config_get_block_string(param, "plugin", NULL); + const char *name = param->GetBlockValue("plugin"); if (name == NULL) MPD_ERROR("decoder configuration without 'plugin' name in line %d", param->line); @@ -216,16 +215,20 @@ decoder_plugin_config(const char *plugin_name) void decoder_plugin_init_all(void) { + struct config_param empty; + for (unsigned i = 0; decoder_plugins[i] != NULL; ++i) { const struct decoder_plugin *plugin = decoder_plugins[i]; const struct config_param *param = decoder_plugin_config(plugin->name); - if (!config_get_block_bool(param, "enabled", true)) + if (param == nullptr) + param = ∅ + else if (!param->GetBlockValue("enabled", true)) /* the plugin is disabled in mpd.conf */ continue; - if (decoder_plugin_init(plugin, param)) + if (decoder_plugin_init(plugin, *param)) decoder_plugins_enabled[i] = true; } } |