v4l2-ctl: --clear-bitmap or --clear-clips didn't actually clear it
authorHans Verkuil <hans.verkuil@cisco.com>
Sun, 27 Jul 2014 11:44:16 +0000 (13:44 +0200)
committerHans Verkuil <hans.verkuil@cisco.com>
Sun, 27 Jul 2014 11:44:16 +0000 (13:44 +0200)
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 <hans.verkuil@cisco.com>
utils/v4l2-ctl/v4l2-ctl-overlay.cpp

index f4f2db1..3cbbd56 100644 (file)
@@ -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));