diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2012-11-13 21:54:20 +0100 |
---|---|---|
committer | Clemens Ladisch <clemens@ladisch.de> | 2012-11-13 21:54:20 +0100 |
commit | da1c24a24c699125aedc8d4f7c97d974b868dacf (patch) | |
tree | f60fc87fd8c641ee50ca8c6e1585f47bc3549950 | |
parent | c6614dbdab1cbe541e7d6cd29f3922510e0b6981 (diff) | |
download | alsa-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.c | 4 |
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++; |