From b8950f8d959050c057f6ab01c0f46dda3e4e52e9 Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Tue, 17 Oct 2023 09:47:30 -0500 Subject: poll_wrapper: use the actual correct timeout for ppoll It's not absolute time. Fixes #12660. --- osdep/poll_wrapper.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osdep/poll_wrapper.c b/osdep/poll_wrapper.c index 48a66d2cd1..4494392912 100644 --- a/osdep/poll_wrapper.c +++ b/osdep/poll_wrapper.c @@ -28,7 +28,9 @@ int mp_poll(struct pollfd *fds, int nfds, int64_t timeout_ns) { #if HAVE_PPOLL - struct timespec ts = mp_time_ns_to_realtime(timeout_ns); + struct timespec ts; + ts.tv_sec = timeout_ns / UINT64_C(1000000000); + ts.tv_nsec = timeout_ns % UINT64_C(1000000000); return ppoll(fds, nfds, &ts, NULL); #endif return poll(fds, nfds, timeout_ns / 1e6); -- cgit v1.2.3