decoder/Thread: move code to DecoderControl::LockIsReplayGainEnabled()
This commit is contained in:
parent
666e5d7904
commit
c0d5bd2048
@ -257,6 +257,12 @@ public:
|
||||
return HasFailed();
|
||||
}
|
||||
|
||||
[[gnu::pure]]
|
||||
bool LockIsReplayGainEnabled() const noexcept {
|
||||
const std::scoped_lock<Mutex> protect(mutex);
|
||||
return replay_gain_mode != ReplayGainMode::OFF;
|
||||
}
|
||||
|
||||
/**
|
||||
* Transition this obejct from DecoderState::START to
|
||||
* DecoderState::DECODE.
|
||||
|
@ -261,12 +261,9 @@ LoadReplayGain(DecoderClient &client, InputStream &is)
|
||||
static void
|
||||
MaybeLoadReplayGain(DecoderBridge &bridge, InputStream &is)
|
||||
{
|
||||
{
|
||||
const std::scoped_lock<Mutex> protect(bridge.dc.mutex);
|
||||
if (bridge.dc.replay_gain_mode == ReplayGainMode::OFF)
|
||||
if (!bridge.dc.LockIsReplayGainEnabled())
|
||||
/* ReplayGain is disabled */
|
||||
return;
|
||||
}
|
||||
|
||||
LoadReplayGain(bridge, is);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user