mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-10 00:15:43 +01:00
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>
This commit is contained in:
parent
c6614dbdab
commit
da1c24a24c
1 changed files with 2 additions and 2 deletions
|
@ -425,10 +425,10 @@ static int set_volume_simple(snd_mixer_elem_t *elem,
|
||||||
invalid = 1;
|
invalid = 1;
|
||||||
if (*p == '+') {
|
if (*p == '+') {
|
||||||
val = orig + val;
|
val = orig + val;
|
||||||
correct = -1;
|
correct = 1;
|
||||||
} else {
|
} else {
|
||||||
val = orig - val;
|
val = orig - val;
|
||||||
correct = 1;
|
correct = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
p++;
|
p++;
|
||||||
|
|
Loading…
Reference in a new issue