audio: fix unmute-at-end logic
commit9624f10aa85039c73d4bdb70e8062daeabaa90c6
authorUoti Urpala <uau@mplayer2.org>
Mon, 9 Apr 2012 19:11:49 +0000 (9 22:11 +0300)
committerUoti Urpala <uau@mplayer2.org>
Wed, 11 Apr 2012 00:52:34 +0000 (11 03:52 +0300)
tree7303f5d0011c5f7a320f0e24d74c42d8e5e2eb3f
parente29cb8f323031b32369bc2104ea1fd4422dd2945
audio: fix unmute-at-end logic

The player tried to disable mute before exiting, so that if mute is
emulated by setting volume to 0 and the volume setting is a
system-global one, we don't leave it at 0. However, the logic doing
this at process exit was flawed, as volume settings are handled by
audio output instances and the audio output that set the mute state
may have been closed earlier. Trying to write reliably working logic
that restores volume at exit only would be tricky, so change the code
to always unmute an audio driver before closing it and restore mute
status if one is opened again later.
command.c
mixer.c
mixer.h
mp_core.h
mplayer.c