Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
940e66bb
Commit
940e66bb
authored
Dec 14, 2009
by
Albin Eldstål-Damlin
Committed by
Max Kellermann
Dec 14, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix and use filter_configured_new()
parent
69391dad
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
25 deletions
+8
-25
filter_config.c
src/filter_config.c
+2
-23
filter_plugin.c
src/filter_plugin.c
+6
-2
No files found.
src/filter_config.c
View file @
940e66bb
...
@@ -88,8 +88,6 @@ filter_chain_parse(struct filter *chain, const char *spec, GError **error_r)
...
@@ -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
// Add each name to the filter chain by instantiating an actual filter
char
**
template_names
=
tokens
;
char
**
template_names
=
tokens
;
while
(
*
template_names
!=
NULL
)
{
while
(
*
template_names
!=
NULL
)
{
const
char
*
plugin_name
;
const
struct
filter_plugin
*
fp
;
struct
filter
*
f
;
struct
filter
*
f
;
const
struct
config_param
*
cfg
;
const
struct
config_param
*
cfg
;
...
@@ -102,29 +100,10 @@ filter_chain_parse(struct filter *chain, const char *spec, GError **error_r)
...
@@ -102,29 +100,10 @@ filter_chain_parse(struct filter *chain, const char *spec, GError **error_r)
break
;
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
// Instantiate one of those filter plugins with the template name as a hint
fp
=
filter_plugin_by_name
(
plugin_name
);
f
=
filter_configured_new
(
cfg
,
error_r
);
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
);
if
(
f
==
NULL
)
{
if
(
f
==
NULL
)
{
g_set_error
(
error_r
,
filter_quark
(),
3
,
// The error has already been set, just stop.
"filter plugin initialization failed: %s"
,
plugin_name
);
break
;
break
;
}
}
...
...
src/filter_plugin.c
View file @
940e66bb
...
@@ -49,14 +49,18 @@ filter_configured_new(const struct config_param *param, GError **error_r)
...
@@ -49,14 +49,18 @@ filter_configured_new(const struct config_param *param, GError **error_r)
assert
(
error_r
==
NULL
||
*
error_r
==
NULL
);
assert
(
error_r
==
NULL
||
*
error_r
==
NULL
);
plugin_name
=
config_get_block_string
(
param
,
"plugin"
,
NULL
);
plugin_name
=
config_get_block_string
(
param
,
"plugin"
,
NULL
);
if
(
plugin_name
==
NULL
)
if
(
plugin_name
==
NULL
)
{
g_set_error
(
error_r
,
config_quark
(),
0
,
g_set_error
(
error_r
,
config_quark
(),
0
,
"No filter plugin specified"
);
"No filter plugin specified"
);
return
NULL
;
}
plugin
=
filter_plugin_by_name
(
plugin_name
);
plugin
=
filter_plugin_by_name
(
plugin_name
);
if
(
plugin
==
NULL
)
if
(
plugin
==
NULL
)
{
g_set_error
(
error_r
,
config_quark
(),
0
,
g_set_error
(
error_r
,
config_quark
(),
0
,
"No such filter plugin: %s"
,
plugin_name
);
"No such filter plugin: %s"
,
plugin_name
);
return
NULL
;
}
return
filter_new
(
plugin
,
param
,
error_r
);
return
filter_new
(
plugin
,
param
,
error_r
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment