From 18034a51384c4c5019508cab63d9abd67a7bb210 Mon Sep 17 00:00:00 2001 From: Pavel Rojtberg Date: Fri, 9 Oct 2015 12:05:29 +0200 Subject: [PATCH] allow icvGetPropertyCAM_V4L to return zero now icvGetPropertyCAM_V4L behaves the same as in cap_libv4l. This also fixes passing boolean values. --- modules/videoio/src/cap_v4l.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/modules/videoio/src/cap_v4l.cpp b/modules/videoio/src/cap_v4l.cpp index f3464f52fc..b43bed60ea 100644 --- a/modules/videoio/src/cap_v4l.cpp +++ b/modules/videoio/src/cap_v4l.cpp @@ -2303,15 +2303,11 @@ static double icvGetPropertyCAM_V4L (CvCaptureCAM_V4L* capture, return -1; } - if(property_id == CV_CAP_PROP_AUTOFOCUS) { - return (double)capture->control.value; - } - /* get the min/max values */ cv::Range range = capture->getRange(property_id); /* all was OK, so convert to 0.0 - 1.0 range, and return the value */ - return ((float)capture->control.value - range.start + 1) / range.size(); + return ((float)capture->control.value - range.start) / range.size(); } #endif /* HAVE_CAMV4L2 */