summaryrefslogtreecommitdiffstats
path: root/video/out/drm_common.c
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2023-11-08 22:49:17 -0600
committerDudemanguy <random342@airmail.cc>2023-11-09 21:31:58 +0000
commit7d86807a5f71989e944269fa430f36f2f32b1d65 (patch)
treedb940e26c2d2971cb3287ab987c89549b89fa78d /video/out/drm_common.c
parenta89ba2c7497ca42f5b7e21144d5bf1a8da193654 (diff)
downloadmpv-7d86807a5f71989e944269fa430f36f2f32b1d65.tar.bz2
mpv-7d86807a5f71989e944269fa430f36f2f32b1d65.tar.xz
vo: don't sleep 1ms always when requested time is in the past
Fixes a899e14b which changed clamp from 0 to 1 ms which effectivelly introduced 1ms sleep always, even if requested until_time_ns is in the past and should request 0 timeout. While at it also fix mp_poll wrapper to respect negative timeout which should mean infinite wait. Also keep the 37d6604 behaviour for very short timeouts, but round only the ones > 100us, anything else is 0. Fixes: a899e14b
Diffstat (limited to 'video/out/drm_common.c')
-rw-r--r--video/out/drm_common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/video/out/drm_common.c b/video/out/drm_common.c
index aeb0bbde52..da45ca27a3 100644
--- a/video/out/drm_common.c
+++ b/video/out/drm_common.c
@@ -1257,7 +1257,7 @@ void vo_drm_wait_events(struct vo *vo, int64_t until_time_ns)
struct vo_drm_state *drm = vo->drm;
if (drm->vt_switcher_active) {
int64_t wait_ns = until_time_ns - mp_time_ns();
- int64_t timeout_ns = MPCLAMP(wait_ns, 1e6, 1e10);
+ int64_t timeout_ns = MPCLAMP(wait_ns, 0, MP_TIME_S_TO_NS(10));
vt_switcher_poll(&drm->vt_switcher, timeout_ns);
} else {
vo_wait_default(vo, until_time_ns);