1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-12-27 04:32:55 +00:00

Fix wrong mixer values on some systems (thanks hoffa)

This commit is contained in:
Nikolas Garofil 2010-02-12 18:57:22 +01:00
parent 656177e0de
commit ac6dff791f

View File

@ -181,6 +181,11 @@ static int mixer_get_avg (int i)
snd_mixer_handle_events (data.mixer);
snd_mixer_selem_get_playback_volume (data.elem, 0, &val);
if(data.vol_max != 100) {
float avgf = ((float)val / data.vol_max) * 100;
int avg = (int)avgf;
return (avgf - avg < 0.5) ? avg : avg + 1;
}
return (int) val;
}
static int mixer_get_left (int i)