From e1f27f003943e86526fa1174754f7a256a6ad56c Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sat, 24 Apr 2010 13:41:21 +0200 Subject: [PATCH] qv4l2: when refreshing controls call queryctrl before setVal. setVal relies on correct control flags for the setWhat() call. So we must update the control flags before calling setVal. Signed-off-by: Hans Verkuil --- utils/qv4l2/ctrl-tab.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/qv4l2/ctrl-tab.cpp b/utils/qv4l2/ctrl-tab.cpp index 6112e99..831edc8 100644 --- a/utils/qv4l2/ctrl-tab.cpp +++ b/utils/qv4l2/ctrl-tab.cpp @@ -519,8 +519,8 @@ void ApplicationWindow::refresh(unsigned ctrl_class) if (ioctl(VIDIOC_G_CTRL, &c)) { errorCtrl(id, errno); } - setVal(id, c.value); queryctrl(m_ctrlMap[id]); + setVal(id, c.value); m_widgetMap[id]->setDisabled(m_ctrlMap[id].flags & CTRL_FLAG_DISABLED); } return; @@ -559,6 +559,7 @@ void ApplicationWindow::refresh(unsigned ctrl_class) for (unsigned i = 0; i < ctrls.count; i++) { unsigned id = c[i].id; + queryctrl(m_ctrlMap[id]); if (m_ctrlMap[id].type == V4L2_CTRL_TYPE_INTEGER64) setVal64(id, c[i].value64); else if (m_ctrlMap[id].type == V4L2_CTRL_TYPE_STRING) { @@ -567,7 +568,6 @@ void ApplicationWindow::refresh(unsigned ctrl_class) } else setVal(id, c[i].value); - queryctrl(m_ctrlMap[id]); m_widgetMap[id]->setDisabled(m_ctrlMap[id].flags & CTRL_FLAG_DISABLED); } } -- 2.7.4