From 37d6604d70c8c594de2817db26356c4c950ac0fd Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 26 Aug 2016 20:22:33 +0200 Subject: x11, wayland: always round up wait times If wait_us is >0 and <500, the wait time gets rounded down 0, effectively turning this into busy waiting. Round it up instead. --- video/out/x11_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'video/out/x11_common.c') diff --git a/video/out/x11_common.c b/video/out/x11_common.c index 1b780598af..8c51329a13 100644 --- a/video/out/x11_common.c +++ b/video/out/x11_common.c @@ -1938,7 +1938,7 @@ void vo_x11_wait_events(struct vo *vo, int64_t until_time_us) { .fd = x11->wakeup_pipe[0], .events = POLLIN }, }; int64_t wait_us = until_time_us - mp_time_us(); - int timeout_ms = MPCLAMP((wait_us + 500) / 1000, 0, 10000); + int timeout_ms = MPCLAMP((wait_us + 999) / 1000, 0, 10000); poll(fds, 2, timeout_ms); -- cgit v1.2.3