mirror of
https://github.com/mpv-player/mpv
synced 2025-01-18 13:14:36 +00:00
options: add option for ignoring patch in resume mechanism
Whatever. Fixes #1281.
This commit is contained in:
parent
98e400216d
commit
82317593e9
@ -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.
|
||||
|
||||
|
@ -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),
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user