From bbda335e021c3a4d6ccfce7916041d4fb089af5c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 6 Mar 2016 23:20:26 +0100 Subject: [PATCH] mixer/pulse: fix integer division rounding --- src/mixer/plugins/PulseMixerPlugin.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mixer/plugins/PulseMixerPlugin.cxx b/src/mixer/plugins/PulseMixerPlugin.cxx index c5f20723b..e0f6407b0 100644 --- a/src/mixer/plugins/PulseMixerPlugin.cxx +++ b/src/mixer/plugins/PulseMixerPlugin.cxx @@ -218,7 +218,7 @@ PulseMixer::SetVolume(unsigned new_volume, Error &error) struct pa_cvolume cvolume; pa_cvolume_set(&cvolume, volume.channels, - (pa_volume_t)new_volume * PA_VOLUME_NORM / 100 + 0.5); + (new_volume * PA_VOLUME_NORM + 50) / 100); bool success = pulse_output_set_volume(output, &cvolume, error); if (success) volume = cvolume;