diff mbox series

v4l2-ctl: Operate on output device if specified

Message ID 20211229074338.7505-1-laurent.pinchart@ideasonboard.com
State New
Headers show
Series v4l2-ctl: Operate on output device if specified | expand

Commit Message

Laurent Pinchart Dec. 29, 2021, 7:43 a.m. UTC
The video output get, set and list options operate on the device set by
--device, even if the --out-device option is specified to select a
different output device. Fix it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 utils/v4l2-ctl/v4l2-ctl.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/utils/v4l2-ctl/v4l2-ctl.cpp b/utils/v4l2-ctl/v4l2-ctl.cpp
index 764a7c716159..1c433355c17b 100644
--- a/utils/v4l2-ctl/v4l2-ctl.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl.cpp
@@ -1471,7 +1471,7 @@  int main(int argc, char **argv)
 	io_set(c_fd);
 	stds_set(c_fd);
 	vidcap_set(c_fd);
-	vidout_set(c_fd);
+	vidout_set(out_device ? c_out_fd : c_fd);
 	overlay_set(c_fd);
 	vbi_set(c_fd);
 	sdr_set(c_fd);
@@ -1488,7 +1488,7 @@  int main(int argc, char **argv)
 	io_get(c_fd);
 	stds_get(c_fd);
 	vidcap_get(c_fd);
-	vidout_get(c_fd);
+	vidout_get(out_device ? c_out_fd : c_fd);
 	overlay_get(c_fd);
 	vbi_get(c_fd);
 	sdr_get(c_fd);
@@ -1504,7 +1504,7 @@  int main(int argc, char **argv)
 	io_list(c_fd);
 	stds_list(c_fd);
 	vidcap_list(c_fd);
-	vidout_list(c_fd);
+	vidout_list(out_device ? c_out_fd : c_fd);
 	overlay_list(c_fd);
 	vbi_list(c_fd);
 	sdr_list(c_fd);