# HG changeset patch # User reimar # Date 1399402922 0 # Node ID 3a9a804e488b2cac65f5fa4cfb2cd28c7ec28088 # Parent e476a46c6a2b70e27c2d17eba8239fe4dcbd7032 mixer: do not unmute to volume 0, instead unmute to max. It's not very useful for unmute to still result in volume 0. Plus it makes it easier to enable sound for devices that were on mute at startup. diff -r e476a46c6a2b -r 3a9a804e488b mixer.c --- a/mixer.c Sat May 03 06:25:05 2014 +0000 +++ b/mixer.c Tue May 06 19:02:02 2014 +0000 @@ -129,7 +129,12 @@ void mixer_mute(mixer_t *mixer) { - if (mixer->muted) mixer_setvolume(mixer, mixer->last_l, mixer->last_r); + if (mixer->muted) { + // unmuting to volume 0 makes no sense + if (mixer->last_l == 0) mixer->last_l = 100; + if (mixer->last_r == 0) mixer->last_r = 100; + mixer_setvolume(mixer, mixer->last_l, mixer->last_r); + } else { mixer_getvolume(mixer, &mixer->last_l, &mixer->last_r);