summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2012-11-13 21:54:20 +0100
committerClemens Ladisch <clemens@ladisch.de>2012-11-13 21:54:20 +0100
commitda1c24a24c699125aedc8d4f7c97d974b868dacf (patch)
treef60fc87fd8c641ee50ca8c6e1585f47bc3549950
parentc6614dbdab1cbe541e7d6cd29f3922510e0b6981 (diff)
downloadalsa-utils-da1c24a24c699125aedc8d4f7c97d974b868dacf.tar.gz
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 <jan.javorek@gmail.com> Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
-rw-r--r--amixer/amixer.c4
1 files changed, 2 insertions, 2 deletions
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++;