diff options
author | wm4 <wm4@nowhere> | 2015-08-22 22:08:17 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-08-22 22:08:17 +0200 |
commit | 602105dbdae5b35dfcd7c060349b42a990bd25a8 (patch) | |
tree | 8d07ab84dfa12396841010b3f7d066688f9352d2 /player | |
parent | 1e4113040c533278f61f66e56e817aba5958f380 (diff) | |
download | mpv-602105dbdae5b35dfcd7c060349b42a990bd25a8.tar.bz2 mpv-602105dbdae5b35dfcd7c060349b42a990bd25a8.tar.xz |
player: add --playlist-pos option
Oddly often requested.
Diffstat (limited to 'player')
-rw-r--r-- | player/loadfile.c | 9 |
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; } |