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
7b02c022
Commit
7b02c022
authored
Jul 17, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
filter/LoadChain: use struct ConfigData
parent
57d77cc8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
8 deletions
+15
-8
LoadChain.cxx
src/filter/LoadChain.cxx
+9
-6
LoadChain.hxx
src/filter/LoadChain.hxx
+5
-1
Init.cxx
src/output/Init.cxx
+1
-1
No files found.
src/filter/LoadChain.cxx
View file @
7b02c022
...
...
@@ -24,7 +24,7 @@
#include "plugins/ChainFilterPlugin.hxx"
#include "config/Param.hxx"
#include "config/Option.hxx"
#include "config/
Global
.hxx"
#include "config/
Data
.hxx"
#include "config/Domain.hxx"
#include "config/Block.hxx"
#include "util/RuntimeError.hxx"
...
...
@@ -34,10 +34,11 @@
#include <string.h>
static
void
filter_chain_append_new
(
PreparedFilter
&
chain
,
const
char
*
template_name
)
filter_chain_append_new
(
PreparedFilter
&
chain
,
const
ConfigData
&
config
,
const
char
*
template_name
)
{
const
auto
*
cfg
=
config
_find_b
lock
(
ConfigBlockOption
::
AUDIO_FILTER
,
"name"
,
template_name
);
const
auto
*
cfg
=
config
.
FindB
lock
(
ConfigBlockOption
::
AUDIO_FILTER
,
"name"
,
template_name
);
if
(
cfg
==
nullptr
)
throw
FormatRuntimeError
(
"Filter template not found: %s"
,
template_name
);
...
...
@@ -53,7 +54,9 @@ filter_chain_append_new(PreparedFilter &chain, const char *template_name)
}
void
filter_chain_parse
(
PreparedFilter
&
chain
,
const
char
*
spec
)
filter_chain_parse
(
PreparedFilter
&
chain
,
const
ConfigData
&
config
,
const
char
*
spec
)
{
const
char
*
const
end
=
spec
+
strlen
(
spec
);
...
...
@@ -61,7 +64,7 @@ filter_chain_parse(PreparedFilter &chain, const char *spec)
const
char
*
comma
=
std
::
find
(
spec
,
end
,
','
);
if
(
comma
>
spec
)
{
const
std
::
string
name
(
spec
,
comma
);
filter_chain_append_new
(
chain
,
name
.
c_str
());
filter_chain_append_new
(
chain
,
config
,
name
.
c_str
());
}
if
(
comma
==
end
)
...
...
src/filter/LoadChain.hxx
View file @
7b02c022
...
...
@@ -20,6 +20,7 @@
#ifndef MPD_FILTER_LOAD_CHAIN_HXX
#define MPD_FILTER_LOAD_CHAIN_HXX
struct
ConfigData
;
class
PreparedFilter
;
/**
...
...
@@ -30,9 +31,12 @@ class PreparedFilter;
* Throws std::runtime_error on error.
*
* @param chain the chain to append filters on
* @param config the global configuration to load filter definitions from
* @param spec the filter chain specification
*/
void
filter_chain_parse
(
PreparedFilter
&
chain
,
const
char
*
spec
);
filter_chain_parse
(
PreparedFilter
&
chain
,
const
ConfigData
&
config
,
const
char
*
spec
);
#endif
src/output/Init.cxx
View file @
7b02c022
...
...
@@ -181,7 +181,7 @@ FilteredAudioOutput::Configure(const ConfigBlock &block)
}
try
{
filter_chain_parse
(
*
prepared_filter
,
filter_chain_parse
(
*
prepared_filter
,
GetGlobalConfig
(),
block
.
GetBlockValue
(
AUDIO_FILTERS
,
""
));
}
catch
(...)
{
/* It's not really fatal - Part of the filter chain
...
...
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