From 685fbf25fecd13524b083f3b05264806d054f21d Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 22 Dec 2011 07:02:19 +0100 Subject: mixer: keep user volume setting when --softvol is used When --softvol is enabled, the volume set by the "volume" property is reset when changing to a new file or crossing ordered chapter boundaries. Fix this by explicitly restoring the volume on audio reinitialization. Now the behavior with --softvol should be the same as if a system mixer is used, and the volume should be persistent across file changes. This also works around an inconsistency with the mute flag. The frontend assumed the mute flag is persistent across file changes, which was not true with --softvol. If not resetting the volume on playing new files is undesired, it can be avoided by putting volume=100 in the mplayer config file. --- mplayer.c | 1 + 1 file changed, 1 insertion(+) (limited to 'mplayer.c') diff --git a/mplayer.c b/mplayer.c index d79d45f057..6b57c695e6 100644 --- a/mplayer.c +++ b/mplayer.c @@ -1448,6 +1448,7 @@ static int build_afilter_chain(struct MPContext *mpctx) result = init_audio_filters(sh_audio, new_srate, &ao->samplerate, &ao->channels, &ao->format); mpctx->mixer.afilter = sh_audio->afilter; + mixer_reinit(&mpctx->mixer); return result; } -- cgit v1.2.3