diff options
author | wm4 <wm4@nowhere> | 2014-07-23 00:20:53 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-07-23 00:20:53 +0200 |
commit | 843f5f47233956cfc03ea656c85771323bc7a1a2 (patch) | |
tree | da64a5bd0013eb97a45c0341faebfbec0addcbd7 /player | |
parent | 10debffc06d3a4ce923ac1062931f0afdf729824 (diff) | |
download | mpv-843f5f47233956cfc03ea656c85771323bc7a1a2.tar.bz2 mpv-843f5f47233956cfc03ea656c85771323bc7a1a2.tar.xz |
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.
Diffstat (limited to 'player')
-rw-r--r-- | player/command.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/player/command.c b/player/command.c index af9350f39c..5e446265ae 100644 --- a/player/command.c +++ b/player/command.c @@ -3597,7 +3597,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); @@ -3612,7 +3612,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; } |