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
9e0ce23a
Commit
9e0ce23a
authored
Feb 19, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test/run_{filter,output}: use config_find_block()
parent
04ba433c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
34 deletions
+4
-34
run_filter.cxx
test/run_filter.cxx
+2
-17
run_output.cxx
test/run_output.cxx
+2
-17
No files found.
test/run_filter.cxx
View file @
9e0ce23a
...
...
@@ -50,26 +50,11 @@ mixer_set_volume(gcc_unused Mixer *mixer,
return
true
;
}
static
const
struct
config_param
*
find_named_config_block
(
ConfigOption
option
,
const
char
*
name
)
{
const
struct
config_param
*
param
=
NULL
;
while
((
param
=
config_get_next_param
(
option
,
param
))
!=
NULL
)
{
const
char
*
current_name
=
param
->
GetBlockValue
(
"name"
);
if
(
current_name
!=
NULL
&&
strcmp
(
current_name
,
name
)
==
0
)
return
param
;
}
return
NULL
;
}
static
Filter
*
load_filter
(
const
char
*
name
)
{
const
struct
config_param
*
param
;
param
=
find_named_config_block
(
CONF_AUDIO_FILTER
,
name
);
const
config_param
*
param
=
config_find_block
(
CONF_AUDIO_FILTER
,
"name"
,
name
);
if
(
param
==
NULL
)
{
fprintf
(
stderr
,
"No such configured filter: %s
\n
"
,
name
);
return
nullptr
;
...
...
test/run_output.cxx
View file @
9e0ce23a
...
...
@@ -53,20 +53,6 @@ filter_plugin_by_name(gcc_unused const char *name)
return
NULL
;
}
static
const
struct
config_param
*
find_named_config_block
(
ConfigOption
option
,
const
char
*
name
)
{
const
struct
config_param
*
param
=
NULL
;
while
((
param
=
config_get_next_param
(
option
,
param
))
!=
NULL
)
{
const
char
*
current_name
=
param
->
GetBlockValue
(
"name"
);
if
(
current_name
!=
NULL
&&
strcmp
(
current_name
,
name
)
==
0
)
return
param
;
}
return
NULL
;
}
PlayerControl
::
PlayerControl
(
gcc_unused
MultipleOutputs
&
_outputs
,
gcc_unused
unsigned
_buffer_chunks
,
gcc_unused
unsigned
_buffered_before_play
)
...
...
@@ -76,9 +62,8 @@ PlayerControl::~PlayerControl() {}
static
AudioOutput
*
load_audio_output
(
EventLoop
&
event_loop
,
const
char
*
name
)
{
const
struct
config_param
*
param
;
param
=
find_named_config_block
(
CONF_AUDIO_OUTPUT
,
name
);
const
config_param
*
param
=
config_find_block
(
CONF_AUDIO_OUTPUT
,
"name"
,
name
);
if
(
param
==
NULL
)
{
fprintf
(
stderr
,
"No such configured audio output: %s
\n
"
,
name
);
return
nullptr
;
...
...
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