v4l2object: Fixed incorrect maximum value for int range

There are objects where maximum is not multiplication of the step,
e.g. there was a combination where max was 65535 with step 2.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7953>
This commit is contained in:
Tomáš Polomský 2024-11-25 15:47:22 +01:00
parent 6f20cd69fe
commit 7008e76c62

View file

@ -2894,7 +2894,11 @@ gst_v4l2_object_probe_caps_for_format (GstV4l2Object * v4l2object,
maxw = MIN (size.stepwise.max_width, G_MAXINT);
maxh = MIN (size.stepwise.max_height, G_MAXINT);
/* FIXME: check for sanity and that min/max are multiples of the steps */
/* ensure maxes are multiples of the steps */
maxw -= maxw % step_w;
maxh -= maxh % step_h;
/* FIXME: check for sanity */
/* we only query details for the min width/height in order to allow for
a big range of frameintervals.