From 809d06dc3ee63d6b6af86c9f1b1b7462af4ff362 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Mon, 29 Jul 2024 19:28:45 +0200 Subject: [PATCH] camera: fix obtaining the current format --- src/camera.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/camera.c b/src/camera.c index 0f4a070..e336abc 100644 --- a/src/camera.c +++ b/src/camera.c @@ -1490,10 +1490,11 @@ static int _open_setup(Camera * camera) _("Cropping not supported")); } /* obtain the current format */ + camera->format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; if(_camera_ioctl(camera, VIDIOC_G_FMT, &camera->format) == -1) return -error_set_code(1, "%s: %s", camera->device, _("Could not obtain the video capture format")); - /* check the current format */ + /* verify the current format */ if(camera->format.type != V4L2_BUF_TYPE_VIDEO_CAPTURE) return -error_set_code(1, "%s: %s", camera->device, _("Unsupported video capture type"));