mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-01-21 12:48:35 -05:00
linux-v4l2: Check udev fd events
udev_event_thread calls poll with two fds: the udev fd, and an eventfd used for shutdown. On FreeBSD we were hanging on shutdown in udev_monitor_receive_device after receiving the eventfd event. Now, if the udev fd reports no events skip the udev_monitor_receive_device call. At shutdown the loop will exit via os_event_try().
This commit is contained in:
@@ -133,12 +133,16 @@ static void *udev_event_thread(void *vptr)
|
||||
|
||||
fds[0].fd = fd;
|
||||
fds[0].events = POLLIN;
|
||||
fds[0].revents = 0;
|
||||
fds[1].fd = udev_event_fd;
|
||||
fds[1].events = POLLIN;
|
||||
|
||||
if (poll(fds, 2, 1000) <= 0)
|
||||
continue;
|
||||
|
||||
if (!fds[0].revents & POLLIN)
|
||||
continue;
|
||||
|
||||
dev = udev_monitor_receive_device(mon);
|
||||
if (!dev)
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user