diff options
author | Albin Eldstål-Damlin <laeder.keps@gmail.com> | 2009-12-14 21:59:32 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-12-14 22:23:05 +0100 |
commit | 940e66bb89cc2ebe05ecc71f78851460e5df35ce (patch) | |
tree | 54c49a8ceecdb51ed249b5ffe4bd3986f4224576 /src/filter_config.c | |
parent | 69391dadda9b759772650b9df62a04b972c8ba5b (diff) | |
download | mpd-940e66bb89cc2ebe05ecc71f78851460e5df35ce.tar.gz mpd-940e66bb89cc2ebe05ecc71f78851460e5df35ce.tar.xz mpd-940e66bb89cc2ebe05ecc71f78851460e5df35ce.zip |
Fix and use filter_configured_new()
Diffstat (limited to 'src/filter_config.c')
-rw-r--r-- | src/filter_config.c | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/src/filter_config.c b/src/filter_config.c index 6eecdbfb1..1a92916ea 100644 --- a/src/filter_config.c +++ b/src/filter_config.c @@ -88,8 +88,6 @@ filter_chain_parse(struct filter *chain, const char *spec, GError **error_r) // Add each name to the filter chain by instantiating an actual filter char **template_names = tokens; while (*template_names != NULL) { - const char *plugin_name; - const struct filter_plugin *fp; struct filter *f; const struct config_param *cfg; @@ -102,29 +100,10 @@ filter_chain_parse(struct filter *chain, const char *spec, GError **error_r) break; } - // Figure out what kind of a plugin that is - plugin_name = config_get_block_string(cfg, "plugin", NULL); - if (plugin_name == NULL) { - g_set_error(error_r, filter_quark(), 1, - "filter configuration without 'plugin' at line %d", - cfg->line); - break; - } - // Instantiate one of those filter plugins with the template name as a hint - fp = filter_plugin_by_name(plugin_name); - if (fp == NULL) { - g_set_error(error_r, filter_quark(), 2, - "filter plugin not found: %s", - plugin_name); - break; - } - - f = filter_new(fp, cfg, NULL); + f = filter_configured_new(cfg, error_r); if (f == NULL) { - g_set_error(error_r, filter_quark(), 3, - "filter plugin initialization failed: %s", - plugin_name); + // The error has already been set, just stop. break; } |