[RFC PATCH 2/5] v4l2-ctl: list once when both OptListCtrls and OptListCtrlsMenus are there

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When both --list-ctrls and --list-ctrls-menus are passed, controls are
listed twice which is accurate but can be confusing.

Treat --list-ctrls-menus as an option modifier when also --list-ctrls is
passed, in order to have the controls listed only once.

Signed-off-by: Antonio Ospite <ao2@xxxxxx>
---
 utils/v4l2-ctl/v4l2-ctl-common.cpp | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/utils/v4l2-ctl/v4l2-ctl-common.cpp b/utils/v4l2-ctl/v4l2-ctl-common.cpp
index 8256cbd9..e2710335 100644
--- a/utils/v4l2-ctl/v4l2-ctl-common.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp
@@ -1091,11 +1091,7 @@ void common_get(cv4l_fd &_fd)
 
 void common_list(cv4l_fd &fd)
 {
-	if (options[OptListCtrlsMenus]) {
-		list_controls(fd.g_fd(), 1);
-	}
-
-	if (options[OptListCtrls]) {
-		list_controls(fd.g_fd(), 0);
+	if (options[OptListCtrls] || options[OptListCtrlsMenus]) {
+		list_controls(fd.g_fd(), options[OptListCtrlsMenus]);
 	}
 }
-- 
2.20.1




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux