aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2025-12-28 00:35:40 +0100
committerdec05eba <dec05eba@protonmail.com>2025-12-28 00:35:40 +0100
commit5857cfa1b4feb1e6f7e2373b20333f77922aa160 (patch)
tree4f8084a9434d0b833766940e86262b254541eaec
parentd5ba3f19fbb25f8588612e420d27a2930e1096a5 (diff)
Correct deactivation of mjpeg if libturbo not available
-rw-r--r--src/capture/v4l2.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/capture/v4l2.c b/src/capture/v4l2.c
index e3dd97c..18c726e 100644
--- a/src/capture/v4l2.c
+++ b/src/capture/v4l2.c
@@ -671,8 +671,11 @@ void gsr_capture_v4l2_list_devices(v4l2_devices_query_callback callback, void *u
if(xioctl(fd, VIDIOC_G_FMT, &fmt) == -1)
goto next;
- const gsr_capture_v4l2_supported_pixfmts supported_pixfmts = gsr_capture_v4l2_get_supported_pixfmts(fd);
- if(supported_pixfmts.yuyv || (supported_pixfmts.mjpeg && has_libturbojpeg_lib))
+ gsr_capture_v4l2_supported_pixfmts supported_pixfmts = gsr_capture_v4l2_get_supported_pixfmts(fd);
+ if(!has_libturbojpeg_lib)
+ supported_pixfmts.mjpeg = false;
+
+ if(supported_pixfmts.yuyv || supported_pixfmts.mjpeg)
callback(v4l2_device_path, supported_pixfmts, (vec2i){ fmt.fmt.pix.width, fmt.fmt.pix.height }, userdata);
next: