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
f18695eb
Commit
f18695eb
authored
7 years ago
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test/run_output: use struct ConfigData
parent
d6b0ecac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
run_output.cxx
test/run_output.cxx
+9
-11
No files found.
test/run_output.cxx
View file @
f18695eb
...
@@ -22,7 +22,8 @@
...
@@ -22,7 +22,8 @@
#include "output/Registry.hxx"
#include "output/Registry.hxx"
#include "output/OutputPlugin.hxx"
#include "output/OutputPlugin.hxx"
#include "config/Param.hxx"
#include "config/Param.hxx"
#include "config/Global.hxx"
#include "config/Data.hxx"
#include "config/File.hxx"
#include "config/Option.hxx"
#include "config/Option.hxx"
#include "config/Block.hxx"
#include "config/Block.hxx"
#include "event/Thread.hxx"
#include "event/Thread.hxx"
...
@@ -43,10 +44,11 @@
...
@@ -43,10 +44,11 @@
#include <stdio.h>
#include <stdio.h>
static
std
::
unique_ptr
<
AudioOutput
>
static
std
::
unique_ptr
<
AudioOutput
>
load_audio_output
(
EventLoop
&
event_loop
,
const
char
*
name
)
LoadAudioOutput
(
const
ConfigData
&
config
,
EventLoop
&
event_loop
,
const
char
*
name
)
{
{
const
auto
*
block
=
config
_find_b
lock
(
ConfigBlockOption
::
AUDIO_OUTPUT
,
const
auto
*
block
=
config
.
FindB
lock
(
ConfigBlockOption
::
AUDIO_OUTPUT
,
"name"
,
name
);
"name"
,
name
);
if
(
block
==
nullptr
)
if
(
block
==
nullptr
)
throw
FormatRuntimeError
(
"No such configured audio output: %s"
,
throw
FormatRuntimeError
(
"No such configured audio output: %s"
,
name
);
name
);
...
@@ -120,15 +122,15 @@ try {
...
@@ -120,15 +122,15 @@ try {
/* read configuration file (mpd.conf) */
/* read configuration file (mpd.conf) */
config_global_init
()
;
ConfigData
config
;
ReadConfigFile
(
config_path
);
ReadConfigFile
(
config
,
config
_path
);
EventThread
io_thread
;
EventThread
io_thread
;
io_thread
.
Start
();
io_thread
.
Start
();
/* initialize the audio output */
/* initialize the audio output */
auto
ao
=
load_audio_output
(
io_thread
.
GetEventLoop
(),
argv
[
2
]);
auto
ao
=
LoadAudioOutput
(
config
,
io_thread
.
GetEventLoop
(),
argv
[
2
]);
/* parse the audio format */
/* parse the audio format */
...
@@ -141,10 +143,6 @@ try {
...
@@ -141,10 +143,6 @@ try {
/* cleanup and exit */
/* cleanup and exit */
ao
.
reset
();
config_global_finish
();
return
EXIT_SUCCESS
;
return
EXIT_SUCCESS
;
}
catch
(...)
{
}
catch
(...)
{
PrintException
(
std
::
current_exception
());
PrintException
(
std
::
current_exception
());
...
...
This diff is collapsed.
Click to expand it.
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