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
04a737e0
Commit
04a737e0
authored
Oct 19, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FilterConfig: move code to filter_chain_append_new()
parent
966c54be
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
16 deletions
+23
-16
FilterConfig.cxx
src/FilterConfig.cxx
+23
-16
No files found.
src/FilterConfig.cxx
View file @
04a737e0
...
@@ -64,6 +64,28 @@ filter_plugin_config(const char *filter_template_name, Error &error)
...
@@ -64,6 +64,28 @@ filter_plugin_config(const char *filter_template_name, Error &error)
return
NULL
;
return
NULL
;
}
}
static
bool
filter_chain_append_new
(
Filter
&
chain
,
const
char
*
template_name
,
Error
&
error
)
{
const
struct
config_param
*
cfg
=
filter_plugin_config
(
template_name
,
error
);
if
(
cfg
==
nullptr
)
// The error has already been set, just stop.
return
false
;
// Instantiate one of those filter plugins with the template name as a hint
Filter
*
f
=
filter_configured_new
(
*
cfg
,
error
);
if
(
f
==
nullptr
)
// The error has already been set, just stop.
return
false
;
const
char
*
plugin_name
=
cfg
->
GetBlockValue
(
"plugin"
,
"unknown"
);
filter_chain_append
(
chain
,
plugin_name
,
f
);
return
true
;
}
unsigned
int
unsigned
int
filter_chain_parse
(
Filter
&
chain
,
const
char
*
spec
,
Error
&
error
)
filter_chain_parse
(
Filter
&
chain
,
const
char
*
spec
,
Error
&
error
)
{
{
...
@@ -79,24 +101,9 @@ filter_chain_parse(Filter &chain, const char *spec, Error &error)
...
@@ -79,24 +101,9 @@ filter_chain_parse(Filter &chain, const char *spec, Error &error)
// Squeeze whitespace
// Squeeze whitespace
g_strstrip
(
*
template_names
);
g_strstrip
(
*
template_names
);
const
struct
config_param
*
cfg
=
if
(
!
filter_chain_append_new
(
chain
,
*
template_names
,
error
))
filter_plugin_config
(
*
template_names
,
error
);
if
(
cfg
==
NULL
)
{
// The error has already been set, just stop.
break
;
}
// Instantiate one of those filter plugins with the template name as a hint
Filter
*
f
=
filter_configured_new
(
*
cfg
,
error
);
if
(
f
==
NULL
)
{
// The error has already been set, just stop.
break
;
break
;
}
const
char
*
plugin_name
=
cfg
->
GetBlockValue
(
"plugin"
,
"unknown"
);
filter_chain_append
(
chain
,
plugin_name
,
f
);
++
added_filters
;
++
added_filters
;
++
template_names
;
++
template_names
;
...
...
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