summaryrefslogtreecommitdiffstats
path: root/input
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2011-07-18 01:18:45 +0300
committerUoti Urpala <uau@mplayer2.org>2011-07-18 01:18:45 +0300
commitc2f5465bcc7af2f5caa88dea2c9aa2861e0311a6 (patch)
treec2ae31c6d1760603fc4cfc37bfbe0d9a05ea7197 /input
parenta4f41308190b79d79a5ac7a50791332e5c1d5600 (diff)
downloadmpv-c2f5465bcc7af2f5caa88dea2c9aa2861e0311a6.tar.bz2
mpv-c2f5465bcc7af2f5caa88dea2c9aa2861e0311a6.tar.xz
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).
Diffstat (limited to 'input')
-rw-r--r--input/input.c7
1 files changed, 3 insertions, 4 deletions
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;