aboutsummaryrefslogtreecommitdiffstats
path: root/src/mixer
diff options
context:
space:
mode:
Diffstat (limited to 'src/mixer')
-rw-r--r--src/mixer/AlsaMixerPlugin.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mixer/AlsaMixerPlugin.cxx b/src/mixer/AlsaMixerPlugin.cxx
index d643a3325..75ba8825c 100644
--- a/src/mixer/AlsaMixerPlugin.cxx
+++ b/src/mixer/AlsaMixerPlugin.cxx
@@ -27,6 +27,7 @@
#include "event/Call.hxx"
#include "util/ASCII.hxx"
#include "util/ReusableArray.hxx"
+#include "util/Clamp.hxx"
#include "util/Error.hxx"
#include "util/Domain.hxx"
#include "Log.hxx"
@@ -372,8 +373,7 @@ AlsaMixer::SetVolume(unsigned volume, Error &error)
level = (long)(((vol / 100.0) * (volume_max - volume_min) +
volume_min) + 0.5);
- level = level > volume_max ? volume_max : level;
- level = level < volume_min ? volume_min : level;
+ level = Clamp(level, volume_min, volume_max);
err = snd_mixer_selem_set_playback_volume_all(elem, level);
if (err < 0) {