From 8708d94c1f74a81caf2a7d8d4a6d737581737dcd Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sun, 27 Jul 2014 13:44:16 +0200 Subject: [PATCH] v4l2-ctl: --clear-bitmap or --clear-clips didn't actually clear it If --clear-bitmap or --clear-clips were combined with --set-fmt-overlay without any other changes, then those options were ignored and VIDIOC_S_FMT was never called. Add a check whether those options were defined to ensure S_FMT is actually called. Signed-off-by: Hans Verkuil --- utils/v4l2-ctl/v4l2-ctl-overlay.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/v4l2-ctl/v4l2-ctl-overlay.cpp b/utils/v4l2-ctl/v4l2-ctl-overlay.cpp index f4f2db1..3cbbd56 100644 --- a/utils/v4l2-ctl/v4l2-ctl-overlay.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-overlay.cpp @@ -514,7 +514,8 @@ free: void overlay_set(int fd) { if ((options[OptSetOverlayFormat] || options[OptTryOverlayFormat]) && - (set_overlay_fmt || bitmap_rects.size() || clips.size())) { + (set_overlay_fmt || options[OptClearClips] || options[OptClearBitmap] || + bitmap_rects.size() || clips.size())) { struct v4l2_format fmt; memset(&fmt, 0, sizeof(fmt)); -- 2.7.4