diff options
author | Guido Cella <guido@guidocella.xyz> | 2021-06-26 17:36:06 +0200 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2021-07-06 15:46:45 +0000 |
commit | b3fccf080369730e1b4d6a3435c90124a74566f7 (patch) | |
tree | d6aad65f1695fdd54f4e5e323326712e8ed6d81f /player | |
parent | d2dd4cacb804f8f95f648c6dc4b0b9481ffa9410 (diff) | |
download | mpv-b3fccf080369730e1b4d6a3435c90124a74566f7.tar.bz2 mpv-b3fccf080369730e1b4d6a3435c90124a74566f7.tar.xz |
player: add append-play flag to loadlist
Closes #5664.
Diffstat (limited to 'player')
-rw-r--r-- | player/command.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/player/command.c b/player/command.c index 66ef01951e..051d83b14d 100644 --- a/player/command.c +++ b/player/command.c @@ -5144,7 +5144,7 @@ static void cmd_loadlist(void *p) struct mp_cmd_ctx *cmd = p; struct MPContext *mpctx = cmd->mpctx; char *filename = cmd->args[0].v.s; - bool append = cmd->args[1].v.i; + int append = cmd->args[1].v.i; struct playlist *pl = playlist_parse_file(filename, cmd->abort->cancel, mpctx->global); @@ -5161,7 +5161,7 @@ static void cmd_loadlist(void *p) if (!new) new = playlist_get_first(mpctx->playlist); - if (!append && new) + if ((!append || (append == 2 && !mpctx->playlist->current)) && new) mp_set_playlist_entry(mpctx, new); struct mpv_node *res = &cmd->result; @@ -6217,7 +6217,10 @@ const struct mp_cmd_def mp_cmds[] = { { "loadlist", cmd_loadlist, { {"url", OPT_STRING(v.s)}, - {"flags", OPT_CHOICE(v.i, {"replace", 0}, {"append", 1}), + {"flags", OPT_CHOICE(v.i, + {"replace", 0}, + {"append", 1}, + {"append-play", 2}), .flags = MP_CMD_OPT_ARG}, }, .spawn_thread = true, |