oops, refactoring that out of AppInit needed an early return
This commit is contained in:
parent
e93e222c52
commit
a687f0bed0
6
main.c
6
main.c
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue