summaryrefslogtreecommitdiffstats
path: root/core/input/input.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/input/input.c')
-rw-r--r--core/input/input.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/input/input.c b/core/input/input.c
index 3f147c30e2..4f97189d1d 100644
--- a/core/input/input.c
+++ b/core/input/input.c
@@ -1367,6 +1367,10 @@ static void read_key_fd(struct input_ctx *ictx, struct input_fd *key_fd)
*/
static void read_events(struct input_ctx *ictx, int time)
{
+ if (ictx->num_key_down) {
+ time = FFMIN(time, 1000 / ictx->ar_rate);
+ time = FFMIN(time, ictx->ar_delay);
+ }
ictx->got_new_events = false;
struct input_fd *key_fds = ictx->key_fds;
struct input_fd *cmd_fds = ictx->cmd_fds;