summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2023-10-17 09:47:30 -0500
committerDudemanguy <random342@airmail.cc>2023-10-17 15:05:33 +0000
commitb8950f8d959050c057f6ab01c0f46dda3e4e52e9 (patch)
tree38ac0e88558cd06bafa69d677d2a91331c3b75f2
parent4a46e4ee022f52893db252084186d06b27f3dc85 (diff)
downloadmpv-b8950f8d959050c057f6ab01c0f46dda3e4e52e9.tar.bz2
mpv-b8950f8d959050c057f6ab01c0f46dda3e4e52e9.tar.xz
poll_wrapper: use the actual correct timeout for ppoll
It's not absolute time. Fixes #12660.
-rw-r--r--osdep/poll_wrapper.c4
1 files changed, 3 insertions, 1 deletions
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);