diff --git a/src/decoder/DecoderControl.cxx b/src/decoder/DecoderControl.cxx index 7d5d6e6cc..f10968e2d 100644 --- a/src/decoder/DecoderControl.cxx +++ b/src/decoder/DecoderControl.cxx @@ -27,8 +27,10 @@ #include -DecoderControl::DecoderControl(Mutex &_mutex, Cond &_client_cond) - :mutex(_mutex), client_cond(_client_cond) {} +DecoderControl::DecoderControl(Mutex &_mutex, Cond &_client_cond, + const ReplayGainConfig &_replay_gain_config) + :mutex(_mutex), client_cond(_client_cond), + replay_gain_config(_replay_gain_config) {} DecoderControl::~DecoderControl() { diff --git a/src/decoder/DecoderControl.hxx b/src/decoder/DecoderControl.hxx index 7afd187e0..c680f0365 100644 --- a/src/decoder/DecoderControl.hxx +++ b/src/decoder/DecoderControl.hxx @@ -158,7 +158,7 @@ struct DecoderControl { */ MusicPipe *pipe; - ReplayGainConfig replay_gain_config; + const ReplayGainConfig replay_gain_config; ReplayGainMode replay_gain_mode = ReplayGainMode::OFF; float replay_gain_db = 0; @@ -170,7 +170,8 @@ struct DecoderControl { * @param _mutex see #mutex * @param _client_cond see #client_cond */ - DecoderControl(Mutex &_mutex, Cond &_client_cond); + DecoderControl(Mutex &_mutex, Cond &_client_cond, + const ReplayGainConfig &_replay_gain_config); ~DecoderControl(); /** diff --git a/src/player/Thread.cxx b/src/player/Thread.cxx index f26261aa5..bf90a859d 100644 --- a/src/player/Thread.cxx +++ b/src/player/Thread.cxx @@ -345,7 +345,6 @@ Player::StartDecoder(MusicPipe &_pipe) { /* copy ReplayGain parameters to the decoder */ const ScopeLock protect(pc.mutex); - dc.replay_gain_config = pc.replay_gain_config; dc.replay_gain_mode = pc.replay_gain_mode; } @@ -1164,7 +1163,7 @@ player_task(void *arg) SetThreadName("player"); - DecoderControl dc(pc.mutex, pc.cond); + DecoderControl dc(pc.mutex, pc.cond, pc.replay_gain_config); decoder_thread_start(dc); MusicBuffer buffer(pc.buffer_chunks);