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); 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);