summaryrefslogtreecommitdiffstats
path: root/player/loadfile.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-08-22 22:08:17 +0200
committerwm4 <wm4@nowhere>2015-08-22 22:08:17 +0200
commit602105dbdae5b35dfcd7c060349b42a990bd25a8 (patch)
tree8d07ab84dfa12396841010b3f7d066688f9352d2 /player/loadfile.c
parent1e4113040c533278f61f66e56e817aba5958f380 (diff)
downloadmpv-602105dbdae5b35dfcd7c060349b42a990bd25a8.tar.bz2
mpv-602105dbdae5b35dfcd7c060349b42a990bd25a8.tar.xz
player: add --playlist-pos option
Oddly often requested.
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;
}