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
982d1bf6
Commit
982d1bf6
authored
Dec 29, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/Init: convert audio_output_setup() to method
parent
a0393e9d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
23 deletions
+27
-23
Init.cxx
src/output/Init.cxx
+22
-23
Internal.hxx
src/output/Internal.hxx
+5
-0
No files found.
src/output/Init.cxx
View file @
982d1bf6
...
...
@@ -204,10 +204,9 @@ AudioOutput::Configure(const ConfigBlock &block)
}
}
static
void
audio_output_s
etup
(
EventLoop
&
event_loop
,
inline
void
AudioOutput
::
S
etup
(
EventLoop
&
event_loop
,
const
ReplayGainConfig
&
replay_gain_config
,
AudioOutput
&
ao
,
MixerListener
&
mixer_listener
,
const
ConfigBlock
&
block
)
{
...
...
@@ -218,42 +217,42 @@ audio_output_setup(EventLoop &event_loop,
block
.
GetBlockValue
(
"replay_gain_handler"
,
"software"
);
if
(
strcmp
(
replay_gain_handler
,
"none"
)
!=
0
)
{
ao
.
prepared_replay_gain_filter
=
prepared_replay_gain_filter
=
NewReplayGainFilter
(
replay_gain_config
);
assert
(
ao
.
prepared_replay_gain_filter
!=
nullptr
);
assert
(
prepared_replay_gain_filter
!=
nullptr
);
ao
.
prepared_other_replay_gain_filter
=
prepared_other_replay_gain_filter
=
NewReplayGainFilter
(
replay_gain_config
);
assert
(
ao
.
prepared_other_replay_gain_filter
!=
nullptr
);
assert
(
prepared_other_replay_gain_filter
!=
nullptr
);
}
else
{
ao
.
prepared_replay_gain_filter
=
nullptr
;
ao
.
prepared_other_replay_gain_filter
=
nullptr
;
prepared_replay_gain_filter
=
nullptr
;
prepared_other_replay_gain_filter
=
nullptr
;
}
/* set up the mixer */
try
{
ao
.
mixer
=
audio_output_load_mixer
(
event_loop
,
ao
,
block
,
ao
.
plugin
.
mixer_plugin
,
*
ao
.
prepared_filter
,
mixer_listener
);
mixer
=
audio_output_load_mixer
(
event_loop
,
*
this
,
block
,
plugin
.
mixer_plugin
,
*
prepared_filter
,
mixer_listener
);
}
catch
(
const
std
::
runtime_error
&
e
)
{
FormatError
(
e
,
"Failed to initialize hardware mixer for '%s'"
,
ao
.
name
);
name
);
}
/* use the hardware mixer for replay gain? */
if
(
strcmp
(
replay_gain_handler
,
"mixer"
)
==
0
)
{
if
(
ao
.
mixer
!=
nullptr
)
replay_gain_filter_set_mixer
(
*
ao
.
prepared_replay_gain_filter
,
ao
.
mixer
,
100
);
if
(
mixer
!=
nullptr
)
replay_gain_filter_set_mixer
(
*
prepared_replay_gain_filter
,
mixer
,
100
);
else
FormatError
(
output_domain
,
"No such mixer for output '%s'"
,
ao
.
name
);
"No such mixer for output '%s'"
,
name
);
}
else
if
(
strcmp
(
replay_gain_handler
,
"software"
)
!=
0
&&
ao
.
prepared_replay_gain_filter
!=
nullptr
)
{
prepared_replay_gain_filter
!=
nullptr
)
{
throw
std
::
runtime_error
(
"Invalid
\"
replay_gain_handler
\"
value"
);
}
...
...
@@ -262,8 +261,8 @@ audio_output_setup(EventLoop &event_loop,
auto
*
f
=
filter_new
(
&
convert_filter_plugin
,
ConfigBlock
());
assert
(
f
!=
nullptr
);
filter_chain_append
(
*
ao
.
prepared_filter
,
"convert"
,
ao
.
convert_filter
.
Set
(
f
));
filter_chain_append
(
*
prepared_filter
,
"convert"
,
convert_filter
.
Set
(
f
));
}
AudioOutput
*
...
...
@@ -300,8 +299,8 @@ audio_output_new(EventLoop &event_loop,
assert
(
ao
!=
nullptr
);
try
{
a
udio_output_s
etup
(
event_loop
,
replay_gain_config
,
*
ao
,
mixer_listener
,
block
);
a
o
->
S
etup
(
event_loop
,
replay_gain_config
,
mixer_listener
,
block
);
}
catch
(...)
{
ao_plugin_finish
(
ao
);
throw
;
...
...
src/output/Internal.hxx
View file @
982d1bf6
...
...
@@ -277,6 +277,11 @@ private:
void
Configure
(
const
ConfigBlock
&
block
);
public
:
void
Setup
(
EventLoop
&
event_loop
,
const
ReplayGainConfig
&
replay_gain_config
,
MixerListener
&
mixer_listener
,
const
ConfigBlock
&
block
);
void
StartThread
();
void
StopThread
();
...
...
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