summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authorwm4 <wm4@mplayer2.org>2012-01-07 14:10:05 +0100
committerwm4 <wm4@mplayer2.org>2012-01-18 04:21:45 +0100
commitaae97b7e254f312e5c7bfbe940cb8515a25bf11d (patch)
tree0444ae3fe25edef952757d2d6b2b79a560209cd9 /mplayer.c
parent15a318b2a56766e7bc2dee5d4cc8f514ba21fe39 (diff)
downloadmpv-aae97b7e254f312e5c7bfbe940cb8515a25bf11d.tar.bz2
mpv-aae97b7e254f312e5c7bfbe940cb8515a25bf11d.tar.xz
audio: properly restore audio volume on exit when mute is used
When you mute audio, mplayer is supposed to restore the volume controls on exit. This affects when --softvol isn't used and the audio output driver volume controls directly affect the system wide volume controls. This wasn't done in some cases.
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/mplayer.c b/mplayer.c
index 52889c7d58..fb1638bbd0 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -714,10 +714,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->edl_muted)
- mixer_mute(&mpctx->mixer);
- if (mpctx->ao)
+ if (mpctx->ao) {
+ mixer_uninit(&mpctx->mixer);
ao_uninit(mpctx->ao, mpctx->stop_play != AT_END_OF_FILE);
+ }
mpctx->ao = NULL;
mpctx->mixer.ao = NULL;
}
@@ -727,8 +727,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 && !mpctx->edl_muted)
- mixer_mute(&mpctx->mixer);
uninit_player(mpctx, INITIALIZED_ALL);
#if defined(__MINGW32__) || defined(__CYGWIN__)
timeEndPeriod(1);
@@ -3124,8 +3122,7 @@ static void edl_seek_reset(MPContext *mpctx)
mpctx->edl_muted = !mpctx->edl_muted;
next_edl_record = next_edl_record->next;
}
- if ((mpctx->user_muted | mpctx->edl_muted) != mpctx->mixer.muted)
- mixer_mute(&mpctx->mixer);
+ mixer_setmuted(&mpctx->mixer, mpctx->edl_muted || mpctx->user_muted);
}
@@ -3153,8 +3150,7 @@ static void edl_update(MPContext *mpctx)
next_edl_record->stop_sec, next_edl_record->length_sec);
} else if (next_edl_record->action == EDL_MUTE) {
mpctx->edl_muted = !mpctx->edl_muted;
- if ((mpctx->user_muted | mpctx->edl_muted) != mpctx->mixer.muted)
- mixer_mute(&mpctx->mixer);
+ mixer_setmuted(&mpctx->mixer, mpctx->edl_muted || mpctx->user_muted);
mp_msg(MSGT_CPLAYER, MSGL_DBG4, "EDL_MUTE: [%f]\n",
next_edl_record->start_sec);
}