]> git.alsa-project.org Git - alsa-utils.git/commit
amixer: improve the raw percentual volume rounding
authorJaroslav Kysela <perex@perex.cz>
Fri, 5 Jun 2020 11:34:37 +0000 (13:34 +0200)
committerJaroslav Kysela <perex@perex.cz>
Fri, 5 Jun 2020 15:01:04 +0000 (17:01 +0200)
commit361734165eee70874ecaab8a647b046d112b8971
treedb4eb74cd251ee28e3796e11a86c85b9a2e46dd6
parent4aadfe334f2322b98e26bf1b88957b4678392c27
amixer: improve the raw percentual volume rounding

In commit "ae9ddeb63443cc2c46e0f0b915466cca0f800372" the rint() was
changed to ceil(). Revert it back. The rint() rounding is more precise
for most cases.

Also, handle the special case where the percentual value is greather
then zero. Set the min + 1 value in this case.

At last, fix the return value in convert_prange() when range is zero.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
amixer/amixer.c