From 749bd8009108547ed5fef4f7498e67ff72287698 Mon Sep 17 00:00:00 2001 From: jasonKercher Date: Mon, 13 Jul 2020 08:29:54 -0400 Subject: [PATCH] Merge pull request #17770 from jasonKercher:3.4_triggered 3.4 Allow first capture to return false * fix first capture timeout * fix first capture timeout --- modules/videoio/src/cap_v4l.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/videoio/src/cap_v4l.cpp b/modules/videoio/src/cap_v4l.cpp index dc82e84571..555af5a1a2 100644 --- a/modules/videoio/src/cap_v4l.cpp +++ b/modules/videoio/src/cap_v4l.cpp @@ -1033,15 +1033,16 @@ bool CvCaptureCAM_V4L::grabFrame() return false; } + // No need to skip this if the first read returns false + /* preparation is ok */ + FirstCapture = false; + #if defined(V4L_ABORT_BADJPEG) // skip first frame. it is often bad -- this is unnotied in traditional apps, // but could be fatal if bad jpeg is enabled if (!read_frame_v4l2()) return false; #endif - - /* preparation is ok */ - FirstCapture = false; } // In the case that the grab frame was without retrieveFrame if (bufferIndex >= 0)