summaryrefslogtreecommitdiffstats
path: root/player/command.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-12-29 22:08:22 +0100
committerwm4 <wm4@nowhere>2014-12-29 22:08:22 +0100
commit6618e5d69ab2f1eef70769e46f4129d13bd7ff29 (patch)
treeff20ad08cc4673073543fbd866a4fff2bc8478e6 /player/command.c
parent40755180113ac58cd98fb0f6758c1466e56d5f94 (diff)
downloadmpv-6618e5d69ab2f1eef70769e46f4129d13bd7ff29.tar.bz2
mpv-6618e5d69ab2f1eef70769e46f4129d13bd7ff29.tar.xz
player: make --shuffle/--merge-files affect runtime loaded playlists
Until now, these options took effect only at program start. This could be confusing when e.g. doing "mpv list.m3u --shuffle". Make them always take effect when a playlist is loaded either via a playlist file, or with the "loadlist" command.
Diffstat (limited to 'player/command.c')
-rw-r--r--player/command.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/player/command.c b/player/command.c
index dbf9167fff..4e5fdc6509 100644
--- a/player/command.c
+++ b/player/command.c
@@ -4343,16 +4343,16 @@ int run_command(MPContext *mpctx, mp_cmd_t *cmd)
bool append = cmd->args[1].v.i;
struct playlist *pl = playlist_parse_file(filename, mpctx->global);
if (pl) {
+ prepare_playlist(mpctx, pl);
+ struct playlist_entry *new = pl->current;
if (!append)
playlist_clear(mpctx->playlist);
playlist_append_entries(mpctx->playlist, pl);
talloc_free(pl);
- if (!append && mpctx->playlist->first) {
- struct playlist_entry *e =
- mp_check_playlist_resume(mpctx, mpctx->playlist);
- mp_set_playlist_entry(mpctx, e ? e : mpctx->playlist->first);
- }
+ if (!append && mpctx->playlist->first)
+ mp_set_playlist_entry(mpctx, new ? new : mpctx->playlist->first);
+
mp_notify_property(mpctx, "playlist");
} else {
MP_ERR(mpctx, "Unable to load playlist %s.\n", filename);