oops, refactoring that out of AppInit needed an early return

This commit is contained in:
lif 2024-12-17 17:16:28 -08:00
parent e93e222c52
commit a687f0bed0
1 changed files with 6 additions and 0 deletions

6
main.c
View File

@ -172,6 +172,7 @@ bool SelectCamera(struct AppState* st) {
SDL_RenderDebugText(renderer, 4, 4, "connect a camera");
SDL_RenderPresent(renderer);
return true;
}
const SDL_CameraID device = devices[st->cam_idx];
@ -185,6 +186,11 @@ bool SelectCamera(struct AppState* st) {
int formats_len = 0;
SDL_CameraSpec** formats = SDL_GetCameraSupportedFormats(device, &formats_len);
if (!formats) {
SDL_Log("SDL_GetCameraSupportedFormats failed: %s", SDL_GetError());
return false;
}
if (st->spec_idx >= formats_len) {
st->spec_idx = 0;
} else if (st->spec_idx < 0) {