summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-08-17 21:56:39 +0200
committerwm4 <wm4@nowhere>2013-08-18 05:58:28 +0200
commitcf880b90701dbcdc9b6fba0005c5933150e743da (patch)
treed28f0db7d5a78fa11a616d9fad55daeeef6577a6
parent34785754198d7898c12f3b9aa4bec051e90b967d (diff)
downloadmpv-cf880b90701dbcdc9b6fba0005c5933150e743da.tar.bz2
mpv-cf880b90701dbcdc9b6fba0005c5933150e743da.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.)
-rw-r--r--mpvcore/mplayer.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/mpvcore/mplayer.c b/mpvcore/mplayer.c
index e7c21cc272..e864d1baaf 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);