diff options
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | main.c | 10 |
2 files changed, 7 insertions, 4 deletions
@@ -64,6 +64,7 @@ You can try deleting/renaming your settings file as a temporary solution, to res <table> <tr><th>Version</th> <th>Description</th> <th>Date</th></tr> <tr><td>0.0.0</td> <td>Initial release</td> <td>2025 Feb 26</td></tr> +<tr><td>0.0.1</td> <td>Fix crash switching to video mode with no camera connected</td> <td>2025 Feb 26</td></tr> </table> ## License @@ -1,4 +1,4 @@ -#define VERSION "0.0.0" +#define VERSION "0.0.1" #define _GNU_SOURCE #include <stdio.h> @@ -1378,9 +1378,11 @@ void main() {\n\ if (state->curr_menu) break; if (video_is_recording(state->video)) break; state->mode = (state->mode + 1) % MODE_COUNT; - // picture format may be different now - PictureFormat picfmt = settings_picture_format_for_camera(state, state->camera); - camera_set_format(state->camera, picfmt, settings_desired_framerate(state), 0, false); + if (state->camera) { + // picture format may be different now + PictureFormat picfmt = settings_picture_format_for_camera(state, state->camera); + camera_set_format(state->camera, picfmt, settings_desired_framerate(state), 0, false); + } break; case SDLK_SPACE: if (!state->camera || state->curr_menu != 0) break; |