From 602105dbdae5b35dfcd7c060349b42a990bd25a8 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 22 Aug 2015 22:08:17 +0200 Subject: player: add --playlist-pos option Oddly often requested. --- player/loadfile.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'player') 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; } -- cgit v1.2.3