summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kmix/mixer.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/kmix/mixer.cpp b/kmix/mixer.cpp
index d020ef47..f2f3d188 100644
--- a/kmix/mixer.cpp
+++ b/kmix/mixer.cpp
@@ -568,7 +568,9 @@ int Mixer::volume( int deviceidx )
}
else
{
- return ( vol.getVolume( Volume::LEFT )*100) / volumeRange ;
+ // Make sure to round correctly, otherwise the volume level will always be 1% too low
+ // and increments of 1% of top of the value read will result in no change to the actual level
+ return ((100.0 * vol.getVolume(Volume::LEFT) + volumeRange / 2) / volumeRange);
}
}