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

Signed-off-by: Bård Eirik Winther <bwint...@cisco.com>
---
 utils/qv4l2/v4l2-api.cpp | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/utils/qv4l2/v4l2-api.cpp b/utils/qv4l2/v4l2-api.cpp
index 9c37be3..7a438af 100644
--- a/utils/qv4l2/v4l2-api.cpp
+++ b/utils/qv4l2/v4l2-api.cpp
@@ -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;
 }
-- 
1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to