summaryrefslogtreecommitdiffstats
path: root/mpvcore
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-08-17 21:56:39 +0200
committerwm4 <wm4@nowhere>2013-08-17 21:56:39 +0200
commit6bbcb861fad0e8cc9bd3cc99069f06f309eaea6b (patch)
tree100b1a0e3e03ca24cef90bb4aeeb05ce2c372510 /mpvcore
parentb018c7d936879dc2ea1bd49b78157a70f9353430 (diff)
downloadmpv-6bbcb861fad0e8cc9bd3cc99069f06f309eaea6b.tar.bz2
mpv-6bbcb861fad0e8cc9bd3cc99069f06f309eaea6b.tar.xz
mplayer: don't make restored options from quit_watch_later per-file local
Consider: mpv file1.mkv file2.mkv and file1.mkv is restored from an earlier session when quit_watch_later was used. Then all restored options were reset when file2.mkv is played, even if the user changed them during playback. This affects for example the fullscreen setting. Make it so that after finishing a resumed file, the previously restored settings are not reset again. (Which means only resuming will forcefully overwrite the settings.)
Diffstat (limited to 'mpvcore')
-rw-r--r--mpvcore/mplayer.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/mpvcore/mplayer.c b/mpvcore/mplayer.c
index 88804939c1..ab8ebe3968 100644
--- a/mpvcore/mplayer.c
+++ b/mpvcore/mplayer.c
@@ -739,12 +739,12 @@ static void load_per_output_config(m_config_t *conf, char *cfg, char *out)
* Tries to load a config file (in file local mode)
* @return 0 if file was not found, 1 otherwise
*/
-static int try_load_config(m_config_t *conf, const char *file)
+static int try_load_config(m_config_t *conf, const char *file, bool local)
{
if (!mp_path_exists(file))
return 0;
mp_tmsg(MSGT_CPLAYER, MSGL_INFO, "Loading config '%s'\n", file);
- m_config_parse_config_file(conf, file, M_SETOPT_BACKUP);
+ m_config_parse_config_file(conf, file, local ? M_SETOPT_BACKUP : 0);
return 1;
}
@@ -767,14 +767,14 @@ static void load_per_file_config(m_config_t *conf, const char * const file,
char dircfg[MP_PATH_MAX];
strcpy(dircfg, cfg);
strcpy(dircfg + (name - cfg), "mpv.conf");
- try_load_config(conf, dircfg);
+ try_load_config(conf, dircfg, true);
- if (try_load_config(conf, cfg))
+ if (try_load_config(conf, cfg, true))
return;
}
if ((confpath = mp_find_user_config_file(name)) != NULL) {
- try_load_config(conf, confpath);
+ try_load_config(conf, confpath, true);
talloc_free(confpath);
}
@@ -889,7 +889,9 @@ static void load_playback_resume(m_config_t *conf, const char *file)
{
char *fname = get_playback_resume_config_filename(file);
if (fname) {
- try_load_config(conf, fname);
+ // Never apply the saved start position to following files
+ m_config_backup_opt(conf, "start");
+ try_load_config(conf, fname, false);
unlink(fname);
}
talloc_free(fname);