Browse Source

v4l2: return success if the device is ready

Green Sky 11 months ago
parent
commit
11129761e7
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/camera/v4l2/SDL_camera_v4l2.c

+ 2 - 0
src/camera/v4l2/SDL_camera_v4l2.c

@@ -107,6 +107,8 @@ static bool V4L2_WaitDevice(SDL_Camera *device)
         rc = select(fd + 1, &fds, NULL, NULL, &tv);
         if ((rc == -1) && (errno == EINTR)) {
             rc = 0;  // pretend it was a timeout, keep looping.
+        } else if (rc > 0) {
+            return true;
         }
 
         // Thread is requested to shut down