diff options
author | wm4 <wm4@nowhere> | 2013-04-10 17:16:49 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-04-10 17:16:49 +0200 |
commit | 889cbc21b1cf69d529b65e5cc8d7193320ad7f8d (patch) | |
tree | 821cf635b08d8babfe78c7f51b81e2a3c45d39e0 /core | |
parent | 593aa1834b7ca31306e7a81c08f9c7d0158d9454 (diff) | |
download | mpv-889cbc21b1cf69d529b65e5cc8d7193320ad7f8d.tar.bz2 mpv-889cbc21b1cf69d529b65e5cc8d7193320ad7f8d.tar.xz |
command: fix loadlist command
A simple inverted condition prevented it from working properly.
Also, make sure that playlist is played from beginning when the playlist
is replaced.
Diffstat (limited to 'core')
-rw-r--r-- | core/command.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/core/command.c b/core/command.c index 66198de166..095e50f4a2 100644 --- a/core/command.c +++ b/core/command.c @@ -1945,14 +1945,16 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) char *filename = cmd->args[0].v.s; bool append = cmd->args[1].v.i; struct playlist *pl = playlist_parse_file(filename); - if (!pl) { + if (pl) { if (!append) playlist_clear(mpctx->playlist); playlist_transfer_entries(mpctx->playlist, pl); talloc_free(pl); - if (!append) - mpctx->stop_play = PT_NEXT_ENTRY; + if (!append) { + mpctx->playlist->current = mpctx->playlist->first; + mpctx->stop_play = PT_CURRENT_ENTRY; + } } else { mp_tmsg(MSGT_CPLAYER, MSGL_ERR, "\nUnable to load playlist %s.\n", filename); |