summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorDavid Logie <djl@mksh.org>2016-09-08 15:50:39 +0100
committerwm4 <wm4@nowhere>2016-09-22 13:46:19 +0200
commit78b3852f7ec7b4c8df72646e313535acacae1fd9 (patch)
tree5187458100fb94fee5536e46b824b4e42504ee1d /player
parent7783f0b7d7037e2420deece510b8315cfe3b8e91 (diff)
downloadmpv-78b3852f7ec7b4c8df72646e313535acacae1fd9.tar.bz2
mpv-78b3852f7ec7b4c8df72646e313535acacae1fd9.tar.xz
player: add --watch-later-directory option
This option allows the user to set the directory where "watch later" files are stored. Signed-off-by: wm4 <wm4@nowhere>
Diffstat (limited to 'player')
-rw-r--r--player/configfiles.c12
1 files changed, 10 insertions, 2 deletions
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");