Commit: d6eb67da974395d992a394775143f3913625fe68
Parent: 06662fcbd67c73c5e8ca2d0604ec2dd515da1912
Author: opask
Date: Sat, 12 Jan 2019 23:03:13 -0700
fix volume calculation on linux
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/linux.c b/linux.c
@@ -27,7 +27,7 @@ getvol(const char *card, const char *output)
snd_mixer_selem_get_playback_volume_range(elem, &min, &max);
/* covert from raw value to percent */
- vol = (double)vol / (double)(max - min) * 100;
+ vol = (double)(vol - min) / (double)(max - min) * 100;
snd_mixer_close(handle);
snd_mixer_selem_id_free(sid);