emotion webcam: fix check for v4l2 video capture device capability 25/143225/1
authorJiyoun Park <jy0703.park@samsung.com>
Wed, 9 Aug 2017 06:24:18 +0000 (15:24 +0900)
committerJiyoun Park <jy0703.park@samsung.com>
Wed, 9 Aug 2017 06:24:18 +0000 (15:24 +0900)
    The negation should be uses after checking the capability bit with the &.
    Better use parenthesis  to make this work.

    Thankls to the sparse sematic parser for spotting this.

Change-Id: I223d0c44b4b2abe0e5ac631a3d9d1eb1b3cd08b7

src/lib/emotion/emotion_webcam.c

index 5003030..fe3c949 100644 (file)
@@ -117,7 +117,7 @@ _emotion_check_device(Emotion_Webcam *ew)
    if (ioctl(fd, VIDIOC_QUERYCAP, &caps) == -1) goto on_error;
 
    /* Likely not a webcam */
-   if (!caps.capabilities & V4L2_CAP_VIDEO_CAPTURE) goto on_error;
+   if (!(caps.capabilities & V4L2_CAP_VIDEO_CAPTURE)) goto on_error;
    if (caps.capabilities & V4L2_CAP_TUNER
        || caps.capabilities & V4L2_CAP_RADIO
        || caps.capabilities & V4L2_CAP_MODULATOR)