From: Clemens Ladisch Date: Tue, 13 Nov 2012 20:54:20 +0000 (+0100) Subject: amixer: fix rounding of relative changes X-Git-Tag: v1.0.27~24 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=da1c24a24c699125aedc8d4f7c97d974b868dacf;p=alsa-utils.git amixer: fix rounding of relative changes When doing control changes by a relative amount, amixer used the wrong rounding direction, which would make it possible to stay at the same raw value if the step was not big enough to reach the next value. Reported-by: Honza Javorek Signed-off-by: Clemens Ladisch --- diff --git a/amixer/amixer.c b/amixer/amixer.c index a0a7387..48ed1b2 100644 --- a/amixer/amixer.c +++ b/amixer/amixer.c @@ -425,10 +425,10 @@ static int set_volume_simple(snd_mixer_elem_t *elem, invalid = 1; if (*p == '+') { val = orig + val; - correct = -1; + correct = 1; } else { val = orig - val; - correct = 1; + correct = -1; } } p++;