summaryrefslogtreecommitdiffstats
path: root/core/input
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-04-24 17:02:52 +0200
committerwm4 <wm4@nowhere>2013-04-24 17:46:40 +0200
commit003a9302856897830716ea97a5e76290656a4107 (patch)
tree47c5440f00d3aedffa913c92971db7b31beda82a /core/input
parent040f95d0f1f3d4b1a2ac202a74cc3335bcd2e3e7 (diff)
downloadmpv-003a9302856897830716ea97a5e76290656a4107.tar.bz2
mpv-003a9302856897830716ea97a5e76290656a4107.tar.xz
input: adjust wait time for key-repeat
Basically, these are additional timers that can expire without making the central select() exit.
Diffstat (limited to 'core/input')
-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;