Commit 75b86c97 authored by Andrey Pavlenko's avatar Andrey Pavlenko Committed by OpenCV Buildbot

Merge pull request #1104 from nikman-ru:cap_reuse

parents decd0c75 21211308
......@@ -490,14 +490,14 @@ VideoCapture::~VideoCapture()
bool VideoCapture::open(const String& filename)
{
if (!isOpened())
if (isOpened()) release();
cap = cvCreateFileCapture(filename.c_str());
return isOpened();
}
bool VideoCapture::open(int device)
{
if (!isOpened())
if (isOpened()) release();
cap = cvCreateCameraCapture(device);
return isOpened();
}
......
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