Commit 1bb938e4 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

v4l2: avoid a pair of nested loops if frame rate is constant

parent cd4578a1
......@@ -926,6 +926,12 @@ int SetupFormat (vlc_object_t *obj, int fd, uint32_t fourcc,
msg_Dbg (obj, " with %"PRIu32"x%"PRIu32" steps",
fse.stepwise.step_width, fse.stepwise.step_height);
if (!(parm->parm.capture.capability & V4L2_CAP_TIMEPERFRAME))
{ /* Frame rate is constant, lets maximize resolution */
fmt->fmt.pix.width = fse.stepwise.max_width;
fmt->fmt.pix.height = fse.stepwise.max_height;
}
else
/* FIXME: slow and dumb */
for (uint32_t width = fse.stepwise.min_width;
width <= fse.stepwise.max_width;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment