mirror of https://github.com/mpv-player/mpv
poll_wrapper: use the actual correct timeout for ppoll
It's not absolute time. Fixes #12660.
This commit is contained in:
parent
4a46e4ee02
commit
b8950f8d95
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue