From 067f37d641ab7ae7171ea4bb362e723b0089e671 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Tue, 19 Aug 2014 08:30:50 -0400 Subject: pulse: use ceil() instead of floor() for volume percentages Fixes GHI#26. --- pulse.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pulse.cc b/pulse.cc index 1253c2d..1b498b0 100644 --- a/pulse.cc +++ b/pulse.cc @@ -77,7 +77,7 @@ static pa_cvolume* value_to_cvol(long value, pa_cvolume *cvol) { } static int volume_as_percent(const pa_cvolume* cvol) { - return pa_cvolume_avg(cvol) * 100.0 / PA_VOLUME_NORM; + return pa_cvolume_avg(cvol) * 100.0 / PA_VOLUME_NORM + 0.5; } static int xstrtol(const char *str, long *out) { -- cgit v1.2.3