summaryrefslogtreecommitdiff
path: root/src/output/Init.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2016-11-25 13:54:55 +0100
committerMax Kellermann <max@musicpd.org>2016-12-03 12:51:02 +0100
commit3000b9dcdecb73081cfc7064c805041fb41082c6 (patch)
tree2960338c0b936fb0357c751215750b1037889d54 /src/output/Init.cxx
parent3b867462a3c889792ea5ffeab2f150dab14ed992 (diff)
filter/ReplayGain: add ReplayGainConfig copy
Remove dependency on ReplayGain global variables.
Diffstat (limited to 'src/output/Init.cxx')
-rw-r--r--src/output/Init.cxx17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/output/Init.cxx b/src/output/Init.cxx
index 9edefa958..5efebb492 100644
--- a/src/output/Init.cxx
+++ b/src/output/Init.cxx
@@ -205,7 +205,9 @@ AudioOutput::Configure(const ConfigBlock &block)
}
static void
-audio_output_setup(EventLoop &event_loop, AudioOutput &ao,
+audio_output_setup(EventLoop &event_loop,
+ const ReplayGainConfig &replay_gain_config,
+ AudioOutput &ao,
MixerListener &mixer_listener,
const ConfigBlock &block)
{
@@ -216,12 +218,14 @@ audio_output_setup(EventLoop &event_loop, AudioOutput &ao,
block.GetBlockValue("replay_gain_handler", "software");
if (strcmp(replay_gain_handler, "none") != 0) {
- ao.prepared_replay_gain_filter = NewReplayGainFilter();
+ ao.prepared_replay_gain_filter =
+ NewReplayGainFilter(replay_gain_config);
assert(ao.prepared_replay_gain_filter != nullptr);
ao.replay_gain_serial = 0;
- ao.prepared_other_replay_gain_filter = NewReplayGainFilter();
+ ao.prepared_other_replay_gain_filter =
+ NewReplayGainFilter(replay_gain_config);
assert(ao.prepared_other_replay_gain_filter != nullptr);
ao.other_replay_gain_serial = 0;
@@ -267,7 +271,9 @@ audio_output_setup(EventLoop &event_loop, AudioOutput &ao,
}
AudioOutput *
-audio_output_new(EventLoop &event_loop, const ConfigBlock &block,
+audio_output_new(EventLoop &event_loop,
+ const ReplayGainConfig &replay_gain_config,
+ const ConfigBlock &block,
MixerListener &mixer_listener,
PlayerControl &pc)
{
@@ -298,7 +304,8 @@ audio_output_new(EventLoop &event_loop, const ConfigBlock &block,
assert(ao != nullptr);
try {
- audio_output_setup(event_loop, *ao, mixer_listener, block);
+ audio_output_setup(event_loop, replay_gain_config,
+ *ao, mixer_listener, block);
} catch (...) {
ao_plugin_finish(ao);
throw;