summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-12-12 23:57:49 +0100
committerwm4 <wm4@nowhere>2014-12-13 00:04:08 +0100
commit82317593e9bc5bd3d7d35ae96ef777ccf801a81c (patch)
treec7f5b0639bd77636744ebd9590bd53d98e07a1e7
parent98e400216d7c6545ffd7d1909c7bfac09b9862f3 (diff)
downloadmpv-82317593e9bc5bd3d7d35ae96ef777ccf801a81c.tar.bz2
mpv-82317593e9bc5bd3d7d35ae96ef777ccf801a81c.tar.xz
options: add option for ignoring patch in resume mechanism
Whatever. Fixes #1281.
-rw-r--r--DOCS/man/options.rst3
-rw-r--r--options/options.c1
-rw-r--r--options/options.h1
-rw-r--r--player/configfiles.c12
4 files changed, 13 insertions, 4 deletions
diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst
index 412d4d355d..3cca6c3326 100644
--- a/DOCS/man/options.rst
+++ b/DOCS/man/options.rst
@@ -414,6 +414,9 @@ Program Behavior
This option may expose privacy-sensitive information and is thus
disabled by default.
+``--ignore-path-in-watch-later-config``
+ Ignore path (i.e. use filename only) when using watch later feature.
+
``--show-profile=<profile>``
Show the description and content of a profile.
diff --git a/options/options.c b/options/options.c
index fb48c39e74..f1bdfde4f8 100644
--- a/options/options.c
+++ b/options/options.c
@@ -502,6 +502,7 @@ const m_option_t mp_opts[] = {
OPT_FLAG("resume-playback", position_resume, 0),
OPT_FLAG("save-position-on-quit", position_save_on_quit, 0),
OPT_FLAG("write-filename-in-watch-later-config", write_filename_in_watch_later_config, 0),
+ OPT_FLAG("ignore-path-in-watch-later-config", ignore_path_in_watch_later_config, 0),
OPT_FLAG("ordered-chapters", ordered_chapters, 0),
OPT_STRING("ordered-chapters-files", ordered_chapters_files, M_OPT_FILE),
diff --git a/options/options.h b/options/options.h
index c73764ceba..a2edf1bb79 100644
--- a/options/options.h
+++ b/options/options.h
@@ -167,6 +167,7 @@ typedef struct MPOpts {
int position_resume;
int position_save_on_quit;
int write_filename_in_watch_later_config;
+ int ignore_path_in_watch_later_config;
int pause;
int keep_open;
int audio_id;
diff --git a/player/configfiles.c b/player/configfiles.c
index a18facad6d..0de1a7ba76 100644
--- a/player/configfiles.c
+++ b/player/configfiles.c
@@ -179,10 +179,14 @@ static char *mp_get_playback_resume_config_filename(struct mpv_global *global,
const char *realpath = fname;
bstr bfname = bstr0(fname);
if (!mp_is_url(bfname)) {
- char *cwd = mp_getcwd(tmp);
- if (!cwd)
- goto exit;
- realpath = mp_path_join(tmp, bstr0(cwd), bstr0(fname));
+ if (opts->ignore_path_in_watch_later_config) {
+ realpath = mp_basename(fname);
+ } else {
+ char *cwd = mp_getcwd(tmp);
+ if (!cwd)
+ goto exit;
+ realpath = mp_path_join(tmp, bstr0(cwd), bstr0(fname));
+ }
}
if (bstr_startswith0(bfname, "dvd://"))
realpath = talloc_asprintf(tmp, "%s - %s", realpath, opts->dvd_device);