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
ac9ce0b3
Commit
ac9ce0b3
authored
Nov 09, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/Init: migrate _setup() from class Error to C++ exceptions
parent
cf2b8146
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
11 deletions
+7
-11
Init.cxx
src/output/Init.cxx
+7
-11
No files found.
src/output/Init.cxx
View file @
ac9ce0b3
...
@@ -205,11 +205,10 @@ AudioOutput::Configure(const ConfigBlock &block)
...
@@ -205,11 +205,10 @@ AudioOutput::Configure(const ConfigBlock &block)
}
}
}
}
static
bool
static
void
audio_output_setup
(
EventLoop
&
event_loop
,
AudioOutput
&
ao
,
audio_output_setup
(
EventLoop
&
event_loop
,
AudioOutput
&
ao
,
MixerListener
&
mixer_listener
,
MixerListener
&
mixer_listener
,
const
ConfigBlock
&
block
,
const
ConfigBlock
&
block
)
Error
&
error
)
{
{
/* create the replay_gain filter */
/* create the replay_gain filter */
...
@@ -258,9 +257,7 @@ audio_output_setup(EventLoop &event_loop, AudioOutput &ao,
...
@@ -258,9 +257,7 @@ audio_output_setup(EventLoop &event_loop, AudioOutput &ao,
"No such mixer for output '%s'"
,
ao
.
name
);
"No such mixer for output '%s'"
,
ao
.
name
);
}
else
if
(
strcmp
(
replay_gain_handler
,
"software"
)
!=
0
&&
}
else
if
(
strcmp
(
replay_gain_handler
,
"software"
)
!=
0
&&
ao
.
prepared_replay_gain_filter
!=
nullptr
)
{
ao
.
prepared_replay_gain_filter
!=
nullptr
)
{
error
.
Set
(
config_domain
,
throw
std
::
runtime_error
(
"Invalid
\"
replay_gain_handler
\"
value"
);
"Invalid
\"
replay_gain_handler
\"
value"
);
return
false
;
}
}
/* the "convert" filter must be the last one in the chain */
/* the "convert" filter must be the last one in the chain */
...
@@ -270,8 +267,6 @@ audio_output_setup(EventLoop &event_loop, AudioOutput &ao,
...
@@ -270,8 +267,6 @@ audio_output_setup(EventLoop &event_loop, AudioOutput &ao,
filter_chain_append
(
*
ao
.
prepared_filter
,
"convert"
,
filter_chain_append
(
*
ao
.
prepared_filter
,
"convert"
,
ao
.
convert_filter
.
Set
(
f
));
ao
.
convert_filter
.
Set
(
f
));
return
true
;
}
}
AudioOutput
*
AudioOutput
*
...
@@ -315,10 +310,11 @@ audio_output_new(EventLoop &event_loop, const ConfigBlock &block,
...
@@ -315,10 +310,11 @@ audio_output_new(EventLoop &event_loop, const ConfigBlock &block,
if
(
ao
==
nullptr
)
if
(
ao
==
nullptr
)
return
nullptr
;
return
nullptr
;
if
(
!
audio_output_setup
(
event_loop
,
*
ao
,
mixer_listener
,
try
{
block
,
error
))
{
audio_output_setup
(
event_loop
,
*
ao
,
mixer_listener
,
block
);
}
catch
(...)
{
ao_plugin_finish
(
ao
);
ao_plugin_finish
(
ao
);
return
nullptr
;
throw
;
}
}
ao
->
player_control
=
&
pc
;
ao
->
player_control
=
&
pc
;
...
...
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