summaryrefslogtreecommitdiffstats
path: root/video/out/wayland_common.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-08-26 20:22:33 +0200
committerwm4 <wm4@nowhere>2016-08-26 20:22:33 +0200
commit37d6604d70c8c594de2817db26356c4c950ac0fd (patch)
treec59d2b6f7531b4e381f9f773873fbc015bf95b62 /video/out/wayland_common.c
parent872b7a26549568dc72cae7fae024c4c3a103c845 (diff)
downloadmpv-37d6604d70c8c594de2817db26356c4c950ac0fd.tar.bz2
mpv-37d6604d70c8c594de2817db26356c4c950ac0fd.tar.xz
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.
Diffstat (limited to 'video/out/wayland_common.c')
-rw-r--r--video/out/wayland_common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c
index d4b7a1eecc..3ea4a3f4a6 100644
--- a/video/out/wayland_common.c
+++ b/video/out/wayland_common.c
@@ -1139,7 +1139,7 @@ void vo_wayland_wait_events(struct vo *vo, int64_t until_time_us)
};
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);
wl_display_dispatch_pending(dp);
wl_display_flush(dp);