[MPlayer-dev-eng] [PATCH 1/2] mixer: do not unmute to volume 0, instead unmute to max.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Tue Apr 8 07:00:59 CEST 2014


On 08.04.2014, at 02:31, Hans-Dieter Kosch <hdkosch at kabelbw.de> wrote:
> Reimar Döffinger wrote:
> 
>> 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.
>> ---
>> mixer.c | 7 ++++++-
>> 1 file changed, 6 insertions(+), 1 deletion(-)
>> diff --git a/mixer.c b/mixer.c
>> index 8b290d5..d2d6e18 100644
>> --- a/mixer.c
>> +++ b/mixer.c
>> @@ -129,7 +129,12 @@ void mixer_getbothvolume(mixer_t *mixer, float *b)
>>  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);
> 
> Unmute to only 10 or 50 or so, in order to not unexpectedly load the speakers (and the audience's ears) with full power?

That completely breaks the intended purpose of working with devices that only have a mute toggle...


More information about the MPlayer-dev-eng mailing list