From: Alexander Reshetnikov Date: Sat, 5 May 2012 17:28:05 +0000 (+0000) Subject: Accelerating the completion of video bypass (bug #1893) X-Git-Tag: accepted/2.0/20130307.220821~364^2~854 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=57e26bde9f9ab72bafb27e84c4bad4430a6c550c;p=profile%2Fivi%2Fopencv.git Accelerating the completion of video bypass (bug #1893) --- 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(); }