diff options
author | wm4 <wm4@nowhere> | 2014-02-20 13:38:39 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-02-20 13:40:32 +0100 |
commit | 857952dce3e78e678bf6d14046e2290e7016d6b8 (patch) | |
tree | db1be38bcd1bed525f6f4a62c8537405be11d993 /input/cmd_list.c | |
parent | 1d0730d22d83e2334db136b0b9f943f02daecef4 (diff) | |
download | mpv-857952dce3e78e678bf6d14046e2290e7016d6b8.tar.bz2 mpv-857952dce3e78e678bf6d14046e2290e7016d6b8.tar.xz |
input: check for abort cmd in multi-commands
MP_CMD_COMMAND_LIST commands (used to implement key bindings with
multiple commands) were not checked for abort commands. Implement it.
Remove the remarks about multi-commands being special from the manpage.
Seek coalescing is handled differently now, and the issue with abort
commands is fixed with this commit.
Diffstat (limited to 'input/cmd_list.c')
-rw-r--r-- | input/cmd_list.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/input/cmd_list.c b/input/cmd_list.c index f89195ad56..c5bfbc34aa 100644 --- a/input/cmd_list.c +++ b/input/cmd_list.c @@ -255,7 +255,7 @@ bool mp_replace_legacy_cmd(void *t, bstr *s) return false; } -bool mp_input_is_abort_cmd(int cmd_id) +static bool is_abort_cmd(int cmd_id) { switch (cmd_id) { case MP_CMD_QUIT: @@ -266,6 +266,20 @@ bool mp_input_is_abort_cmd(int cmd_id) return false; } +bool mp_input_is_abort_cmd(struct mp_cmd *cmd) +{ + if (is_abort_cmd(cmd->id)) + return true; + if (cmd->id == MP_CMD_COMMAND_LIST) { + for (struct mp_cmd *sub = cmd->args[0].v.p; sub; sub = sub->queue_next) + { + if (mp_input_is_abort_cmd(cmd)) + return true; + } + } + return false; +} + void mp_print_cmd_list(struct mp_log *out) { for (int i = 0; mp_cmds[i].name; i++) { |