Accelerating the completion of video bypass (bug #1893)

This commit is contained in:
Alexander Reshetnikov 2012-05-05 17:28:05 +00:00
parent 3ec43a11ed
commit 57e26bde9f

View File

@ -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();
}