mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-10-29 19:22:36 +08:00
linux-v4l2: Fix select in capture thread.
This moves the enabling/resetting of the file descriptors inside the capture loop so it is done before each select call. Why this even worked before is unclear, but doing it the *right* way seems to reduce latency.
This commit is contained in:
@@ -151,12 +151,11 @@ static void *v4l2_thread(void *vptr)
|
||||
|
||||
data->frames = 0;
|
||||
|
||||
FD_ZERO(&fds);
|
||||
FD_SET(data->dev, &fds);
|
||||
|
||||
v4l2_prep_obs_frame(data, &out, plane_offsets);
|
||||
|
||||
while (os_event_try(data->event) == EAGAIN) {
|
||||
FD_ZERO(&fds);
|
||||
FD_SET(data->dev, &fds);
|
||||
tv.tv_sec = 1;
|
||||
tv.tv_usec = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user