{decoder,player}/Control: add ReplayGain{Config,Mode} attributes

Don't use the global variables in class DecoderBridge; instead,
forward these values to the decoder thread via PlayerControl and
DecoderControl.
This commit is contained in:
Max Kellermann
2016-11-25 12:51:55 +01:00
parent 77c1f54876
commit ee57c3490a
5 changed files with 30 additions and 4 deletions

View File

@@ -342,6 +342,13 @@ Player::StartDecoder(MusicPipe &_pipe)
assert(queued || pc.command == PlayerCommand::SEEK);
assert(pc.next_song != nullptr);
{
/* 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;
}
SongTime start_time = pc.next_song->GetStartTime() + pc.seek_time;
dc.Start(new DetachedSong(*pc.next_song),