From fe53a376a3c2d6e7aa14c73df56df816e2d89d6f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 4 Aug 2013 13:54:14 +0200 Subject: PlaylistPlugin: pass config_param reference --- src/PlaylistRegistry.cxx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/PlaylistRegistry.cxx') diff --git a/src/PlaylistRegistry.cxx b/src/PlaylistRegistry.cxx index 5e8b453df..97681d99e 100644 --- a/src/PlaylistRegistry.cxx +++ b/src/PlaylistRegistry.cxx @@ -83,8 +83,7 @@ playlist_plugin_config(const char *plugin_name) assert(plugin_name != NULL); while ((param = config_get_next_param(CONF_PLAYLIST_PLUGIN, param)) != NULL) { - const char *name = - config_get_block_string(param, "name", NULL); + const char *name = param->GetBlockValue("name"); if (name == NULL) MPD_ERROR("playlist configuration without 'plugin' name in line %d", param->line); @@ -99,17 +98,20 @@ playlist_plugin_config(const char *plugin_name) void playlist_list_global_init(void) { + const config_param empty; + for (unsigned i = 0; playlist_plugins[i] != NULL; ++i) { const struct playlist_plugin *plugin = playlist_plugins[i]; const struct config_param *param = playlist_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; playlist_plugins_enabled[i] = - playlist_plugin_init(playlist_plugins[i], param); + playlist_plugin_init(playlist_plugins[i], *param); } } -- cgit v1.2.3