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
This commit is contained in:
wm4 2014-09-02 22:16:20 +02:00
parent 2da246b9f7
commit 6c1e528518
1 changed files with 3 additions and 0 deletions

View File

@ -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");
}