diff options
author | Uoti Urpala <uau@mplayer2.org> | 2012-04-09 22:11:49 +0300 |
---|---|---|
committer | Uoti Urpala <uau@mplayer2.org> | 2012-04-11 03:52:34 +0300 |
commit | 9624f10aa85039c73d4bdb70e8062daeabaa90c6 (patch) | |
tree | 7303f5d0011c5f7a320f0e24d74c42d8e5e2eb3f /mplayer.c | |
parent | e29cb8f323031b32369bc2104ea1fd4422dd2945 (diff) |
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.
Diffstat (limited to 'mplayer.c')
-rw-r--r-- | mplayer.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -681,8 +681,10 @@ void uninit_player(struct MPContext *mpctx, unsigned int mask) if (mask & INITIALIZED_AO) { mpctx->initialized_flags &= ~INITIALIZED_AO; current_module = "uninit_ao"; - if (mpctx->ao) + if (mpctx->ao) { + mixer_uninit(&mpctx->mixer); ao_uninit(mpctx->ao, mpctx->stop_play != AT_END_OF_FILE); + } mpctx->ao = NULL; } @@ -691,8 +693,6 @@ void uninit_player(struct MPContext *mpctx, unsigned int mask) void exit_player_with_rc(struct MPContext *mpctx, enum exit_reason how, int rc) { - if (mpctx->user_muted) - mixer_setmute(&mpctx->mixer, false); uninit_player(mpctx, INITIALIZED_ALL); #if defined(__MINGW32__) || defined(__CYGWIN__) timeEndPeriod(1); |