提交 9988e1b6 编写于 作者: T Todor Tomov

cap_v4l: Fix private control enumeration end condition

Currently the private control enumeration will be stopped when QUERYCTRL
returns -EINVAL only. It is possible however that other errors occur.

One particular case is when the v4l2 device doesn't support any controls
and doesn't implement the QUERYCTRL ioctl. In that case the v4l2
framework returns -ENOTTY. In that case the current control enumeration
will go in an endless loop.

To fix this change the control enumeration stop condition. If any errors
occur, end the control enumeration.
Signed-off-by: NTodor Tomov <todor.tomov@linaro.org>
上级 0f0a82b6
......@@ -512,9 +512,11 @@ static void v4l2_scan_controls(CvCaptureCAM_V4L* capture)
for (ctrl_id = V4L2_CID_PRIVATE_BASE;;ctrl_id++)
{
errno = 0;
v4l2_control_range(capture, ctrl_id);
if (errno == EINVAL)
if (errno)
break;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册