Commit 072e39c9 authored by Max Kellermann's avatar Max Kellermann

filter/ReplayGain: skip PcmVolume if a mixer is set

Previously, volume was applied twice: once by PcmVolume, and again by the hardware mixer.
parent 8dc3f3b2
ver 0.19.17 (not yet released)
* replay gain: fix "replay_gain_handler mixer" setting
ver 0.19.16 (2016/06/13)
* faster seeking
......
......@@ -134,8 +134,6 @@ ReplayGainFilter::Update()
volume = pcm_float_to_volume(scale);
}
pv.SetVolume(volume);
if (mixer != nullptr) {
/* update the hardware mixer volume */
......@@ -146,7 +144,8 @@ ReplayGainFilter::Update()
Error error;
if (!mixer_set_volume(mixer, _volume, error))
LogError(error, "Failed to update hardware mixer");
}
} else
pv.SetVolume(volume);
}
static Filter *
......@@ -174,7 +173,9 @@ ReplayGainFilter::Close()
ConstBuffer<void>
ReplayGainFilter::FilterPCM(ConstBuffer<void> src, gcc_unused Error &error)
{
return pv.Apply(src);
return mixer != nullptr
? src
: pv.Apply(src);
}
const struct filter_plugin replay_gain_filter_plugin = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment