Merge pull request #1109 from nikman-ru:cap_reuse_24x

This commit is contained in:
Roman Donchenko 2013-07-12 11:38:59 +04:00 committed by OpenCV Buildbot
commit 09ec483d02

View File

@ -489,14 +489,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();
}