From 645ea1c5979b7656a137d9198c63cc1d012905a4 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sat, 26 Jul 2008 14:25:00 +0200 Subject: v4l2-ctl: fix find_controls when dealing with old-style controls. From: Hans Verkuil 'v4l2-ctl -C contrast' would not show the control description. Signed-off-by: Hans Verkuil --- v4l2-apps/util/v4l2-ctl.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'v4l2-apps') diff --git a/v4l2-apps/util/v4l2-ctl.cpp b/v4l2-apps/util/v4l2-ctl.cpp index 3e56e63a1..920fbd1a3 100644 --- a/v4l2-apps/util/v4l2-ctl.cpp +++ b/v4l2-apps/util/v4l2-ctl.cpp @@ -634,13 +634,17 @@ static void find_controls(int fd) for (id = V4L2_CID_USER_BASE; id < V4L2_CID_LASTP1; id++) { qctrl.id = id; if (ioctl(fd, VIDIOC_QUERYCTRL, &qctrl) == 0 && - !(qctrl.flags & V4L2_CTRL_FLAG_DISABLED)) + !(qctrl.flags & V4L2_CTRL_FLAG_DISABLED)) { ctrl_str2id[name2var(qctrl.name)] = qctrl.id; + ctrl_id2str[qctrl.id] = name2var(qctrl.name); + } } for (qctrl.id = V4L2_CID_PRIVATE_BASE; ioctl(fd, VIDIOC_QUERYCTRL, &qctrl) == 0; qctrl.id++) { - if (!(qctrl.flags & V4L2_CTRL_FLAG_DISABLED)) + if (!(qctrl.flags & V4L2_CTRL_FLAG_DISABLED)) { ctrl_str2id[name2var(qctrl.name)] = qctrl.id; + ctrl_id2str[qctrl.id] = name2var(qctrl.name); + } } } -- cgit v1.2.3