summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
Diffstat (limited to 'video')
-rw-r--r--video/out/drm_common.c9
-rw-r--r--video/out/x11_common.c5
2 files changed, 8 insertions, 6 deletions
diff --git a/video/out/drm_common.c b/video/out/drm_common.c
index dd53793dbb..f8d68dfa81 100644
--- a/video/out/drm_common.c
+++ b/video/out/drm_common.c
@@ -42,6 +42,7 @@
#include "common/msg.h"
#include "options/m_config.h"
#include "osdep/io.h"
+#include "osdep/poll_wrapper.h"
#include "osdep/timer.h"
#include "misc/ctype.h"
#include "video/out/vo.h"
@@ -283,12 +284,12 @@ static void vt_switcher_destroy(struct vt_switcher *s)
close(vt_switcher_pipe[1]);
}
-static void vt_switcher_poll(struct vt_switcher *s, int timeout_ms)
+static void vt_switcher_poll(struct vt_switcher *s, int timeout_ns)
{
struct pollfd fds[1] = {
{ .events = POLLIN, .fd = vt_switcher_pipe[0] },
};
- poll(fds, 1, timeout_ms);
+ mp_poll(fds, 1, timeout_ns);
if (!fds[0].revents)
return;
@@ -1309,8 +1310,8 @@ 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();
- int timeout_ms = MPCLAMP(wait_ns / 1e6, 1, 10000);
- vt_switcher_poll(&drm->vt_switcher, timeout_ms);
+ int64_t timeout_ns = MPCLAMP(wait_ns, 1e6, 1e10);
+ vt_switcher_poll(&drm->vt_switcher, timeout_ns);
} else {
vo_wait_default(vo, until_time_ns);
}
diff --git a/video/out/x11_common.c b/video/out/x11_common.c
index be5002b068..f77f4c86f8 100644
--- a/video/out/x11_common.c
+++ b/video/out/x11_common.c
@@ -55,6 +55,7 @@
#include "vo.h"
#include "win_state.h"
#include "osdep/io.h"
+#include "osdep/poll_wrapper.h"
#include "osdep/timer.h"
#include "osdep/subprocess.h"
@@ -2177,9 +2178,9 @@ void vo_x11_wait_events(struct vo *vo, int64_t until_time_ns)
{ .fd = x11->wakeup_pipe[0], .events = POLLIN },
};
int64_t wait_ns = until_time_ns - mp_time_ns();
- int timeout_ms = MPCLAMP(wait_ns / 1e6, 1, 10000);
+ int64_t timeout_ns = MPCLAMP(wait_ns, 1e6, 1e10);
- poll(fds, 2, timeout_ms);
+ mp_poll(fds, 2, timeout_ns);
if (fds[1].revents & POLLIN)
mp_flush_wakeup_pipe(x11->wakeup_pipe[0]);