summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-09-02 22:16:20 +0200
committerAlessandro Ghedini <alessandro@ghedini.me>2014-09-03 23:21:36 +0200
commit29d3bbdaa252078bf83ef8d9e09ffc2034434e7f (patch)
tree92cf6981a5d980bae97ccd1305d9cb9d588493bb
parent16c3b27d0ac4ec59c399ff9f31d2abd763914400 (diff)
downloadmpv-29d3bbdaa252078bf83ef8d9e09ffc2034434e7f.tar.bz2
mpv-29d3bbdaa252078bf83ef8d9e09ffc2034434e7f.tar.xz
player: properly resume playlists loaded at runtime
If a playlist is loaded from the internal playlist (like "mpv playlist.m3u"), then attempt to resume from it. CC: @mpv-player/stable
-rw-r--r--player/loadfile.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/player/loadfile.c b/player/loadfile.c
index a941f7af68..119362bd3b 100644
--- a/player/loadfile.c
+++ b/player/loadfile.c
@@ -924,10 +924,13 @@ static void print_resolve_contents(struct mp_log *log,
static void transfer_playlist(struct MPContext *mpctx, struct playlist *pl)
{
if (pl->first) {
+ struct playlist_entry *new = mp_check_playlist_resume(mpctx, pl);
playlist_transfer_entries(mpctx->playlist, pl);
// current entry is replaced
if (mpctx->playlist->current)
playlist_remove(mpctx->playlist, mpctx->playlist->current);
+ if (new)
+ mpctx->playlist->current = new;
} else {
MP_WARN(mpctx, "Empty playlist!\n");
}