From 2d8e26bb72d8b1645f98979f2715e1a12e9d1ab5 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 23 Jul 2014 00:20:53 +0200 Subject: command: add append-play loadfile mode "loadfile filename append-play" will now always append the file to the playlist, and if nothing is playing yet, start playback. I don't want to change the semantics of "append" mode, so a new mode is needed. Probably fixes issue #950. --- player/command.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'player/command.c') diff --git a/player/command.c b/player/command.c index 952d348af9..7282eb30fd 100644 --- a/player/command.c +++ b/player/command.c @@ -3550,7 +3550,7 @@ int run_command(MPContext *mpctx, mp_cmd_t *cmd) case MP_CMD_LOADFILE: { char *filename = cmd->args[0].v.s; - bool append = cmd->args[1].v.i; + int append = cmd->args[1].v.i; if (!append) playlist_clear(mpctx->playlist); @@ -3565,7 +3565,7 @@ int run_command(MPContext *mpctx, mp_cmd_t *cmd) } playlist_add(mpctx->playlist, entry); - if (!append) + if (!append || (append == 2 && !mpctx->playlist->current)) mp_set_playlist_entry(mpctx, mpctx->playlist->first); break; } -- cgit v1.2.3