Skip to content

Commit 6bafc2c

Browse files
kvaghel1alalek
authored andcommitted
Fix frame timestamp in VideoCapture::get
1 parent 777a008 commit 6bafc2c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

modules/highgui/src/cap_v4l.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,12 +1164,12 @@ static int read_frame_v4l2(CvCaptureCAM_V4L* capture) {
11641164
//printf("got data in buff %d, len=%d, flags=0x%X, seq=%d, used=%d)\n",
11651165
// buf.index, buf.length, buf.flags, buf.sequence, buf.bytesused);
11661166

1167-
if (-1 == ioctl (capture->deviceHandle, VIDIOC_QBUF, &buf))
1168-
perror ("VIDIOC_QBUF");
1169-
11701167
//set timestamp in capture struct to be timestamp of most recent frame
11711168
capture->timestamp = buf.timestamp;
11721169

1170+
if (-1 == ioctl (capture->deviceHandle, VIDIOC_QBUF, &buf))
1171+
perror ("VIDIOC_QBUF");
1172+
11731173
return 1;
11741174
}
11751175

0 commit comments

Comments
 (0)