summaryrefslogtreecommitdiffstats
path: root/player/loadfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'player/loadfile.c')
-rw-r--r--player/loadfile.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/player/loadfile.c b/player/loadfile.c
index 9857d8a1a8..2115c72058 100644
--- a/player/loadfile.c
+++ b/player/loadfile.c
@@ -804,13 +804,20 @@ void prepare_playlist(struct MPContext *mpctx, struct playlist *pl)
{
struct MPOpts *opts = mpctx->opts;
+ pl->current = NULL;
+
+ if (opts->playlist_pos >= 0)
+ pl->current = playlist_entry_from_index(pl, opts->playlist_pos);
+
if (opts->shuffle)
playlist_shuffle(pl);
if (opts->merge_files)
merge_playlist_files(pl);
- pl->current = mp_check_playlist_resume(mpctx, pl);
+ if (!pl->current)
+ pl->current = mp_check_playlist_resume(mpctx, pl);
+
if (!pl->current)
pl->current = pl->first;
}