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:
parent
656177e0de
commit
ac6dff791f
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user