Skip to contentSkip to conversation

qv4l2: Fixed a bug in the v4l2-api

PATCH New Bård Eirik Winther 1 participant 2 messages Jul 29, 2013 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

cover qv4l2: Fixed a bug in the v4l2-api

Fixed a bug where the get_interval in v4l2-api where it would test for a compatibility flag irrelevant to the feature support and resulting return false.

#1 lore raw

PATCH 1/1 qv4l2: Fixed a bug in the v4l2-api

The get_interval would return false even if devices had support for this

---
 utils/qv4l2/v4l2-api.cpp | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
utils/qv4l2/v4l2-api.cpp +5 -7
index 9c37be3..7a438af 100644
@@ -613,13 +613,11 @@ bool v4l2::set_interval(v4l2_fract interval)
 bool v4l2::get_interval(v4l2_fract &interval)
 {
 	v4l2_streamparm parm;
-
 	parm.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
-	if (ioctl(VIDIOC_G_PARM, &parm) >= 0 &&
-	    (parm.parm.capture.capability & V4L2_CAP_TIMEPERFRAME)) {
-		interval = parm.parm.capture.timeperframe;
-		return true;
-        }
 
-	return false;
+	if (ioctl(VIDIOC_G_PARM, &parm) < 0)
+		return false;
+
+	interval = parm.parm.capture.timeperframe;
+	return interval.numerator && interval.denominator;
 }
Signature · 1 line
1.8.3.2