diff options
-rw-r--r-- | DOCS/man/options.rst | 7 | ||||
-rw-r--r-- | options/options.c | 1 | ||||
-rw-r--r-- | options/options.h | 1 | ||||
-rw-r--r-- | player/configfiles.c | 12 |
4 files changed, 19 insertions, 2 deletions
diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index 97e0bb5776..eaa2ad6449 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -387,6 +387,13 @@ Program Behavior This behavior is disabled by default, but is always available when quitting the player with Shift+Q. +``--watch-later-directory=<path>`` + + The directory in which to store the "watch later" temporary files. + + The default is a subdirectory named "watch_later" underneath the + config directory (usually ``~/.config/mpv/``). + ``--dump-stats=<filename>`` Write certain statistics to the given file. The file is truncated on opening. The file will contain raw samples, each with a timestamp. To diff --git a/options/options.c b/options/options.c index 8d45c21b8d..cd51842ea3 100644 --- a/options/options.c +++ b/options/options.c @@ -587,6 +587,7 @@ const m_option_t mp_opts[] = { 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_STRING("watch-later-directory", watch_later_directory, 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 48654c4296..3e4978f0cb 100644 --- a/options/options.h +++ b/options/options.h @@ -190,6 +190,7 @@ typedef struct MPOpts { int position_save_on_quit; int write_filename_in_watch_later_config; int ignore_path_in_watch_later_config; + char *watch_later_directory; int pause; int keep_open; double image_display_duration; diff --git a/player/configfiles.c b/player/configfiles.c index 3ef6a66fb0..95eb91c377 100644 --- a/player/configfiles.c +++ b/player/configfiles.c @@ -192,6 +192,14 @@ static char *mp_get_playback_resume_config_filename(struct MPContext *mpctx, conf = talloc_asprintf_append(conf, "%02X", md5[i]); if (!mpctx->cached_watch_later_configdir) { + char *wl_dir = mpctx->opts->watch_later_directory; + if (wl_dir && wl_dir[0]) { + mpctx->cached_watch_later_configdir = + mp_get_user_path(mpctx, mpctx->global, wl_dir); + } + } + + if (!mpctx->cached_watch_later_configdir) { mpctx->cached_watch_later_configdir = mp_find_user_config_file(mpctx, mpctx->global, MP_WATCH_LATER_CONF); } @@ -314,12 +322,12 @@ void mp_write_watch_later_conf(struct MPContext *mpctx) goto exit; } - mp_mk_config_dir(mpctx->global, MP_WATCH_LATER_CONF); - conffile = mp_get_playback_resume_config_filename(mpctx, cur->filename); if (!conffile) goto exit; + mp_mk_config_dir(mpctx->global, mpctx->cached_watch_later_configdir); + MP_INFO(mpctx, "Saving state.\n"); FILE *file = fopen(conffile, "wb"); |