summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2012-04-09 17:39:01 +0300
committerUoti Urpala <uau@mplayer2.org>2012-04-11 00:13:11 +0300
commit7807f46cd1b8f58ee8f2e5f6d7240d7ca7502311 (patch)
tree85233d07756f55a756a2f103773b24013cc57955 /mplayer.c
parent3a01606dc05b2cedb9792a6f8adefeba6e434ab0 (diff)
downloadmpv-7807f46cd1b8f58ee8f2e5f6d7240d7ca7502311.tar.bz2
mpv-7807f46cd1b8f58ee8f2e5f6d7240d7ca7502311.tar.xz
audio: keep volume level internally (not only in AO)
Current volume was always queried from the the audio output driver (or filter in case of --softvol). The only case where it was stored on mixer level was that when turning off mute, volume was set to the value it had before mute was activated. Change the mixer code to always store the current target volume internally. It still checks for significant changes from external sources and resets the internal value in that case. The main functionality changes are: Volume will now be kept separately from mute status. Increasing or decreasing volume will now change it relative to the original value before mute, even if mute is implemented by setting AO level volume to 0. Volume changes no longer automatically disable mute. The exception is relative changes up (like the volume increase key in default keybindings); that's the only case which still disables mute. Keeping the value internally avoids problems with granularity of possible volume values supported by AO. Increase/decrease keys could work unsymmetrically, or when specifying a smaller than default --volstep, even fail completely. In one case occurring in practice, if the AO only supports changing volume in steps of about 2 and rounds down the requested volume, then volume down key would decrease by 4 but volume up would increase by 2 (previous volume plus or minus the default change of 3, rounded down to a multiple of 2). Now, the internal value will keep full precision.
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mplayer.c b/mplayer.c
index d410008dff..7696b92ce8 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -692,7 +692,7 @@ 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_mute(&mpctx->mixer);
+ mixer_setmute(&mpctx->mixer, false);
uninit_player(mpctx, INITIALIZED_ALL);
#if defined(__MINGW32__) || defined(__CYGWIN__)
timeEndPeriod(1);