Skip to content

Commit

Permalink
Fixed bug #9672 - v4l2/camera prevent deadlock when there is a delay …
Browse files Browse the repository at this point in the history
…between SDL_ReleaseCameraFrame and SDL_CloseCamera
  • Loading branch information
1bsyl authored and slouken committed May 12, 2024
1 parent d4ce918 commit 7b25263
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/camera/v4l2/SDL_camera_v4l2.c
Expand Up @@ -107,6 +107,12 @@ static int V4L2_WaitDevice(SDL_CameraDevice *device)
if ((retval == -1) && (errno == EINTR)) {
retval = 0; // pretend it was a timeout, keep looping.
}

// Thread is requested to shut down
if (SDL_AtomicGet(&device->shutdown)) {
return 0;
}

} while (retval == 0);

return retval;
Expand Down

0 comments on commit 7b25263

Please sign in to comment.