diff options
author | wm4 <wm4@nowhere> | 2014-12-29 22:08:22 +0100 |
---|---|---|
committer | Diogo Franco (Kovensky) <diogomfranco@gmail.com> | 2015-01-25 17:00:08 +0900 |
commit | da2167088018e01c5e15cb1eda6ea370236e6a96 (patch) | |
tree | cf3a84df8994ed92010b92330590db0aabe57954 /player/command.c | |
parent | 2cac69f221e91a9e8eae6010cb92bae33a4587f2 (diff) | |
download | mpv-da2167088018e01c5e15cb1eda6ea370236e6a96.tar.bz2 mpv-da2167088018e01c5e15cb1eda6ea370236e6a96.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.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/player/command.c b/player/command.c index 63d524ada6..b44d218f52 100644 --- a/player/command.c +++ b/player/command.c @@ -4259,16 +4259,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); |