diff options
author | wm4 <wm4@nowhere> | 2013-09-04 16:08:36 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-09-04 16:15:09 +0200 |
commit | 3bb217d5e9fda241693c7f3c6a4046c845d8d5a8 (patch) | |
tree | c9bc6582aefd62d4a1c31c300c527395c2da6a14 /mpvcore/mp_core.h | |
parent | b0f8e03f17c3dca88fa28265e88f7ec4c0d01d4d (diff) | |
download | mpv-3bb217d5e9fda241693c7f3c6a4046c845d8d5a8.tar.bz2 mpv-3bb217d5e9fda241693c7f3c6a4046c845d8d5a8.tar.xz |
mplayer: allow resuming from playlist
This includes the case of passing multiple files to command line
(internally this is the same as loading a playlist).
Resuming works by finding the first playlist entry that can be resumed.
Alternative implementations would be possible, such as hashing the
playlist contents. But this implementation is simpler, and doesn't have
the disadvantage that changes to the playlist (like appending entries)
will throw away the resume point.
This makes loading large playlists a bit slower, because it has to look
into ~/.mpv/watch_later/ for every entry. Loading a 15000 entries
playlist now increases from 150ms to 400ms. Considering you rarely load
playlists this big with mpv (because it's impractical considering the
terminal and non-GUI nature of the player), this is probably ok.
Diffstat (limited to 'mpvcore/mp_core.h')
-rw-r--r-- | mpvcore/mp_core.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/mpvcore/mp_core.h b/mpvcore/mp_core.h index ac79d6ca0c..3bf2c8d6aa 100644 --- a/mpvcore/mp_core.h +++ b/mpvcore/mp_core.h @@ -334,6 +334,7 @@ struct playlist_entry *mp_next_file(struct MPContext *mpctx, int direction); int mp_get_cache_percent(struct MPContext *mpctx); void mp_write_watch_later_conf(struct MPContext *mpctx); void mp_set_playlist_entry(struct MPContext *mpctx, struct playlist_entry *e); +struct playlist_entry *mp_resume_playlist(struct playlist *pl); void mp_force_video_refresh(struct MPContext *mpctx); void mp_print_version(int always); |