From ce9a854d54900d050cf1efcf26081d875223e448 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 5 May 2013 19:37:29 +0200 Subject: core: add playback resume feature (manual/opt-in) A "watch later" command is now mapped to Shift+Q. This quits the player and stores the playback state in a config file in ~/.mpv/watch_later/. When calling the player with the same file again, playback is resumed at that time position. It's also possible to make mpv save playback state always on quit with the --save-position-on-quit option. Likewise, resuming can be disabled with the --no-resume-playback option. This also attempts to save some playback parameters, like fullscreen state or track selection. This will unconditionally override config settings and command line options (which is probably not what you would expect, but in general nobody will really care about this). Some things are not backed up, because that would cause various problems. Additional subtitle files, video filters, etc. are not stored because that would be too hard and fragile. Volume/mute state are not stored because it would mess up if the system mixer is used, or if the system mixer was readjusted in the meantime. Basically, the tradeoff between perfect state restoration and complexity/fragility makes it not worth to attempt to implement it perfectly, even if the result is a little bit inconsistent. --- core/cfg-mplayer.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'core/cfg-mplayer.h') diff --git a/core/cfg-mplayer.h b/core/cfg-mplayer.h index 570c403f9c..f2e90d07d2 100644 --- a/core/cfg-mplayer.h +++ b/core/cfg-mplayer.h @@ -650,6 +650,9 @@ const m_option_t mplayer_opts[]={ {"{", NULL, CONF_TYPE_STORE, CONF_NOCFG, 0, 0, NULL}, {"}", NULL, CONF_TYPE_STORE, CONF_NOCFG, 0, 0, NULL}, + OPT_FLAG("resume-playback", position_resume, 0), + OPT_FLAG("save-position-on-quit", position_save_on_quit, 0), + OPT_FLAG("ordered-chapters", ordered_chapters, 0), OPT_INTRANGE("chapter-merge-threshold", chapter_merge_threshold, 0, 0, 10000), -- cgit v1.2.3