diff options
author | wm4 <wm4@nowhere> | 2013-04-10 19:07:26 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-04-10 21:29:04 +0200 |
commit | 62daa08d3b9e32f6d7f81bae4407faab4347c90d (patch) | |
tree | f2aacda70508d317677c4def60e18eee86271f0d /audio/mixer.h | |
parent | 2c3e5428c2f1a2811ac138a9167aadcef5c7b26d (diff) | |
download | mpv-62daa08d3b9e32f6d7f81bae4407faab4347c90d.tar.bz2 mpv-62daa08d3b9e32f6d7f81bae4407faab4347c90d.tar.xz |
mplayer: keep volume persistent, even when using --volume
Consider:
mpv --volume 10 file1.mkv file2.mkv
Before this commit, the volume was reset to 10 when playing file2.mkv.
This was inconsistent to most other options. E.g. --brightness is a
rather similar case.
In general, settings should never be reset when playing the next file,
unless the option was explicitly marked file-local. This commit
corrects the behavior of the --volume and --mute options.
File local --volume still works as expected:
mpv --{ --volume 10 file1.mkv file2.mkv --}
This sets the volume always to 10 on playback start.
Move the m_config_leave_file_local() call down so that the mixer code
in uninit_player() can set the option volume and mute variables without
overwriting the global option values.
Another subtle issue is that we don't want to set volume if there's no
need to, which is why the user_set_volume/mute fields are introduced.
This is important because setting the volume might change the system
volume depending on other options.
Diffstat (limited to 'audio/mixer.h')
-rw-r--r-- | audio/mixer.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/audio/mixer.h b/audio/mixer.h index 3de92e1e03..3160c20cfe 100644 --- a/audio/mixer.h +++ b/audio/mixer.h @@ -41,6 +41,8 @@ typedef struct mixer { * and needs to be restored after the driver is reinitialized. */ const char *restore_volume; float balance; + bool user_set_mute; + bool user_set_volume; } mixer_t; void mixer_reinit(struct mixer *mixer, struct ao *ao); |