From 6fd9edc50f54070428121b8ae30d4f0fe7ee28ab Mon Sep 17 00:00:00 2001 From: kvaghel1 Date: Mon, 22 May 2017 21:22:35 -0400 Subject: [PATCH] Fix frame timestamp in VideoCapture::get --- modules/videoio/src/cap_v4l.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/videoio/src/cap_v4l.cpp b/modules/videoio/src/cap_v4l.cpp index 309dcaaff4..e2fbc60cd2 100644 --- a/modules/videoio/src/cap_v4l.cpp +++ b/modules/videoio/src/cap_v4l.cpp @@ -861,12 +861,12 @@ static int read_frame_v4l2(CvCaptureCAM_V4L* capture) { //printf("got data in buff %d, len=%d, flags=0x%X, seq=%d, used=%d)\n", // buf.index, buf.length, buf.flags, buf.sequence, buf.bytesused); - if (-1 == ioctl (capture->deviceHandle, VIDIOC_QBUF, &buf)) - perror ("VIDIOC_QBUF"); - //set timestamp in capture struct to be timestamp of most recent frame capture->timestamp = buf.timestamp; + if (-1 == ioctl (capture->deviceHandle, VIDIOC_QBUF, &buf)) + perror ("VIDIOC_QBUF"); + return 1; }