From c2f5465bcc7af2f5caa88dea2c9aa2861e0311a6 Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Mon, 18 Jul 2011 01:18:45 +0300 Subject: input: fix problem with key autorepeat Recent commit 82b8f89baeaf ("input: rework event reading and command queuing") had a problem in the handling of commands generated by autorepeat code (this code is only used with joystick and Apple IR remote input). Fix (still untested though). --- input/input.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'input') diff --git a/input/input.c b/input/input.c index fe7acbb3e7..951f5ac04f 100644 --- a/input/input.c +++ b/input/input.c @@ -1487,25 +1487,24 @@ mp_cmd_t *mp_input_get_cmd(struct input_ctx *ictx, int time, int peek_only) if (!queue->num_cmds) queue = &ictx->key_cmd_queue; if (!queue->num_cmds) { - queue = NULL; ret = check_autorepeat(ictx); if (!ret) return NULL; + queue_add(queue, ret, false); } else ret = queue->first; for (struct cmd_filter *cf = cmd_filters; cf; cf = cf->next) { if (cf->filter(ret, cf->ctx)) { // The filter ate the cmd, so remove it from the queue - if (queue) - queue_pop(queue); + queue_pop(queue); mp_cmd_free(ret); // Retry with next command return mp_input_get_cmd(ictx, 0, peek_only); } } - if (!peek_only && queue) + if (!peek_only) queue_pop(queue); return ret; -- cgit v1.2.3