The cause of this issue is that continuous timeout is occurred on select().
(The webcam on host PC does not work properly for some reason.)
Fixed as follows:
If the timeout occurs for 5 seconds continually,
raises a error and notifies to upper layer.
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
fd_set fds;
struct timeval tv;
int ret;
+ static uint32_t timeout_n;
FD_ZERO(&fds);
FD_SET(v4l2_fd, &fds);
__raise_err_intr(state);
return -1;
} else if (!ret) {
- ERR("Select timed out\n");
+ timeout_n++;
+ ERR("Select timed out: count(%u)\n", timeout_n);
+ if (timeout_n >= 5) {
+ __raise_err_intr(state);
+ return -1;
+ }
return 0;
}
__raise_err_intr(state);
return -1;
}
+
+ /* clear the skip count for select time-out */
+ if (timeout_n > 0) {
+ timeout_n = 0;
+ }
+
return 0;
}