Skip to content

Commit 749bd80

Browse files
authored
Merge pull request opencv#17770 from jasonKercher:3.4_triggered
3.4 Allow first capture to return false * fix first capture timeout * fix first capture timeout
1 parent 1c0b70b commit 749bd80

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

modules/videoio/src/cap_v4l.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,15 +1033,16 @@ bool CvCaptureCAM_V4L::grabFrame()
10331033
return false;
10341034
}
10351035

1036+
// No need to skip this if the first read returns false
1037+
/* preparation is ok */
1038+
FirstCapture = false;
1039+
10361040
#if defined(V4L_ABORT_BADJPEG)
10371041
// skip first frame. it is often bad -- this is unnotied in traditional apps,
10381042
// but could be fatal if bad jpeg is enabled
10391043
if (!read_frame_v4l2())
10401044
return false;
10411045
#endif
1042-
1043-
/* preparation is ok */
1044-
FirstCapture = false;
10451046
}
10461047
// In the case that the grab frame was without retrieveFrame
10471048
if (bufferIndex >= 0)

0 commit comments

Comments
 (0)