From b3968ecf05c11cf42c8120be3a1d716c4cc71b5d Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 19 May 2018 18:44:03 +0200 Subject: input: remove now unused "abort command" and cancel infrastructure The previous commit removed all uses. --- input/input.c | 33 ++------------------------------- 1 file changed, 2 insertions(+), 31 deletions(-) (limited to 'input/input.c') diff --git a/input/input.c b/input/input.c index 20c39dd4ac..c8f1a64ad5 100644 --- a/input/input.c +++ b/input/input.c @@ -153,9 +153,6 @@ struct input_ctx { struct cmd_queue cmd_queue; - void (*cancel)(void *cancel_ctx); - void *cancel_ctx; - void (*wakeup_cb)(void *ctx); void *wakeup_ctx; }; @@ -531,13 +528,11 @@ static void release_down_cmd(struct input_ctx *ictx, bool drop_current) } // We don't want the append to the command queue indefinitely, because that -// could lead to situations where recovery would take too long. On the other -// hand, don't drop commands that will abort playback. +// could lead to situations where recovery would take too long. static bool should_drop_cmd(struct input_ctx *ictx, struct mp_cmd *cmd) { struct cmd_queue *queue = &ictx->cmd_queue; - return queue_count_cmds(queue) >= ictx->opts->key_fifo_size && - !mp_input_is_abort_cmd(cmd); + return queue_count_cmds(queue) >= ictx->opts->key_fifo_size; } static struct mp_cmd *resolve_key(struct input_ctx *ictx, int code) @@ -883,26 +878,10 @@ static void adjust_max_wait_time(struct input_ctx *ictx, double *time) } } -static bool test_abort_cmd(struct input_ctx *ictx, struct mp_cmd *new) -{ - if (!mp_input_is_maybe_abort_cmd(new)) - return false; - if (mp_input_is_abort_cmd(new)) - return true; - // Abort only if there are going to be at least 2 commands in the queue. - for (struct mp_cmd *cmd = ictx->cmd_queue.first; cmd; cmd = cmd->queue_next) { - if (mp_input_is_maybe_abort_cmd(cmd)) - return true; - } - return false; -} - int mp_input_queue_cmd(struct input_ctx *ictx, mp_cmd_t *cmd) { input_lock(ictx); if (cmd) { - if (ictx->cancel && test_abort_cmd(ictx, cmd)) - ictx->cancel(ictx->cancel_ctx); queue_add_tail(&ictx->cmd_queue, cmd); mp_input_wakeup(ictx); } @@ -1423,14 +1402,6 @@ void mp_input_uninit(struct input_ctx *ictx) talloc_free(ictx); } -void mp_input_set_cancel(struct input_ctx *ictx, void (*cb)(void *c), void *c) -{ - input_lock(ictx); - ictx->cancel = cb; - ictx->cancel_ctx = c; - input_unlock(ictx); -} - bool mp_input_use_alt_gr(struct input_ctx *ictx) { input_lock(ictx); -- cgit v1.2.3