From 57e26bde9f9ab72bafb27e84c4bad4430a6c550c Mon Sep 17 00:00:00 2001 From: Alexander Reshetnikov Date: Sat, 5 May 2012 17:28:05 +0000 Subject: [PATCH] Accelerating the completion of video bypass (bug #1893) --- modules/highgui/src/cap.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/highgui/src/cap.cpp b/modules/highgui/src/cap.cpp index d863431..45ef082 100644 --- a/modules/highgui/src/cap.cpp +++ b/modules/highgui/src/cap.cpp @@ -494,10 +494,13 @@ bool VideoCapture::retrieve(Mat& image, int channel) bool VideoCapture::read(Mat& image) { + if (get(CV_CAP_PROP_POS_FRAMES) < get(CV_CAP_PROP_FRAME_COUNT)) if(!grab()) image.release(); else retrieve(image); + else + image.release(); return !image.empty(); } -- 2.7.4