Fixed bug #9672 - v4l2/camera prevent deadlock when there is a delay between SDL_ReleaseCameraFrame and SDL_CloseCamera

This commit is contained in:
Sylvain
2024-05-11 23:12:13 +02:00
committed by Sam Lantinga
parent d4ce9183b8
commit 7b252634fd

View File

@@ -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;