Commit 57e26bde authored by Alexander Reshetnikov's avatar Alexander Reshetnikov

Accelerating the completion of video bypass (bug #1893)

parent 3ec43a11
...@@ -494,10 +494,13 @@ bool VideoCapture::retrieve(Mat& image, int channel) ...@@ -494,10 +494,13 @@ bool VideoCapture::retrieve(Mat& image, int channel)
bool VideoCapture::read(Mat& image) bool VideoCapture::read(Mat& image)
{ {
if (get(CV_CAP_PROP_POS_FRAMES) < get(CV_CAP_PROP_FRAME_COUNT))
if(!grab()) if(!grab())
image.release(); image.release();
else else
retrieve(image); retrieve(image);
else
image.release();
return !image.empty(); return !image.empty();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment