summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-09-02 22:16:20 +0200
committerwm4 <wm4@nowhere>2014-09-02 22:16:20 +0200
commit6c1e5285181a0799c689ab71fc703fa67917e303 (patch)
tree88f3f85a85bd3c675b9a9de6e7af91bb545f8832
parent2da246b9f715a5694263b1ed3dee30b2001b6ed4 (diff)
downloadmpv-6c1e5285181a0799c689ab71fc703fa67917e303.tar.bz2
mpv-6c1e5285181a0799c689ab71fc703fa67917e303.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 46a7067a9f..00a10aa34f 100644
--- a/player/loadfile.c
+++ b/player/loadfile.c
@@ -930,10 +930,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");
}