summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Partition.cxx5
-rw-r--r--src/player/Control.cxx6
-rw-r--r--src/player/Control.hxx9
-rw-r--r--test/run_output.cxx9
4 files changed, 17 insertions, 12 deletions
diff --git a/src/Partition.cxx b/src/Partition.cxx
index 03de4d16a..309d5e4fd 100644
--- a/src/Partition.cxx
+++ b/src/Partition.cxx
@@ -33,7 +33,8 @@ Partition::Partition(Instance &_instance,
global_events(instance.event_loop, BIND_THIS_METHOD(OnGlobalEvent)),
playlist(max_length, *this),
outputs(*this),
- pc(*this, outputs, buffer_chunks, buffered_before_play)
+ pc(*this, outputs, buffer_chunks, buffered_before_play,
+ replay_gain_config)
{
}
@@ -51,7 +52,7 @@ Partition::UpdateEffectiveReplayGainMode(ReplayGainMode mode)
? ReplayGainMode::TRACK
: ReplayGainMode::ALBUM;
- pc.LockSetReplayGain(replay_gain_config, mode);
+ pc.LockSetReplayGainMode(mode);
outputs.SetReplayGainMode(mode);
}
diff --git a/src/player/Control.cxx b/src/player/Control.cxx
index 5fdf01794..cc56a19a3 100644
--- a/src/player/Control.cxx
+++ b/src/player/Control.cxx
@@ -29,10 +29,12 @@
PlayerControl::PlayerControl(PlayerListener &_listener,
MultipleOutputs &_outputs,
unsigned _buffer_chunks,
- unsigned _buffered_before_play)
+ unsigned _buffered_before_play,
+ const ReplayGainConfig &_replay_gain_config)
:listener(_listener), outputs(_outputs),
buffer_chunks(_buffer_chunks),
- buffered_before_play(_buffered_before_play)
+ buffered_before_play(_buffered_before_play),
+ replay_gain_config(_replay_gain_config)
{
}
diff --git a/src/player/Control.hxx b/src/player/Control.hxx
index f8e9d8b3f..144bcade6 100644
--- a/src/player/Control.hxx
+++ b/src/player/Control.hxx
@@ -169,7 +169,7 @@ struct PlayerControl {
CrossFadeSettings cross_fade;
- ReplayGainConfig replay_gain_config;
+ const ReplayGainConfig replay_gain_config;
ReplayGainMode replay_gain_mode = ReplayGainMode::OFF;
double total_play_time = 0;
@@ -186,7 +186,8 @@ struct PlayerControl {
PlayerControl(PlayerListener &_listener,
MultipleOutputs &_outputs,
unsigned buffer_chunks,
- unsigned buffered_before_play);
+ unsigned buffered_before_play,
+ const ReplayGainConfig &_replay_gain_config);
~PlayerControl();
/**
@@ -468,10 +469,8 @@ public:
return cross_fade.mixramp_delay;
}
- void LockSetReplayGain(const ReplayGainConfig &_config,
- ReplayGainMode _mode) {
+ void LockSetReplayGainMode(ReplayGainMode _mode) {
const ScopeLock protect(mutex);
- replay_gain_config = _config;
replay_gain_mode = _mode;
}
diff --git a/test/run_output.cxx b/test/run_output.cxx
index 5c09ca057..d79ec8ff1 100644
--- a/test/run_output.cxx
+++ b/test/run_output.cxx
@@ -53,10 +53,12 @@ filter_plugin_by_name(gcc_unused const char *name)
PlayerControl::PlayerControl(PlayerListener &_listener,
MultipleOutputs &_outputs,
unsigned _buffer_chunks,
- unsigned _buffered_before_play)
+ unsigned _buffered_before_play,
+ const ReplayGainConfig &_replay_gain_config)
:listener(_listener), outputs(_outputs),
buffer_chunks(_buffer_chunks),
- buffered_before_play(_buffered_before_play) {}
+ buffered_before_play(_buffered_before_play),
+ replay_gain_config(_replay_gain_config) {}
PlayerControl::~PlayerControl() {}
static AudioOutput *
@@ -70,7 +72,8 @@ load_audio_output(EventLoop &event_loop, const char *name)
static struct PlayerControl dummy_player_control(*(PlayerListener *)nullptr,
*(MultipleOutputs *)nullptr,
- 32, 4);
+ 32, 4,
+ ReplayGainConfig());
return audio_output_new(event_loop, ReplayGainConfig(), *param,
*(MixerListener *)nullptr,