未验证 提交 a0e8adbc 编写于 作者: J Jim 提交者: GitHub

Merge pull request #2547 from kkartaltepe/v4l2-control-inf-loop

linux-v4l2: readonly controls cause infinite loop
...@@ -98,6 +98,8 @@ int_fast32_t v4l2_update_controls(int_fast32_t dev, obs_properties_t *props, ...@@ -98,6 +98,8 @@ int_fast32_t v4l2_update_controls(int_fast32_t dev, obs_properties_t *props,
memset(&qctrl, 0, sizeof(qctrl)); memset(&qctrl, 0, sizeof(qctrl));
qctrl.id = V4L2_CTRL_FLAG_NEXT_CTRL; qctrl.id = V4L2_CTRL_FLAG_NEXT_CTRL;
while (0 == v4l2_ioctl(dev, VIDIOC_QUERYCTRL, &qctrl)) { while (0 == v4l2_ioctl(dev, VIDIOC_QUERYCTRL, &qctrl)) {
qctrl.id |= V4L2_CTRL_FLAG_NEXT_CTRL;
if (qctrl.flags & V4L2_CTRL_FLAG_DISABLED) { if (qctrl.flags & V4L2_CTRL_FLAG_DISABLED) {
blog(LOG_INFO, "found control %s but it is disabled", blog(LOG_INFO, "found control %s but it is disabled",
qctrl.name); qctrl.name);
...@@ -145,8 +147,6 @@ int_fast32_t v4l2_update_controls(int_fast32_t dev, obs_properties_t *props, ...@@ -145,8 +147,6 @@ int_fast32_t v4l2_update_controls(int_fast32_t dev, obs_properties_t *props,
(char *)qctrl.name, qctrl.default_value); (char *)qctrl.name, qctrl.default_value);
break; break;
} }
qctrl.id |= V4L2_CTRL_FLAG_NEXT_CTRL;
} }
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册