mirror of
https://github.com/opencv/opencv.git
synced 2024-11-29 05:29:54 +08:00
Merge pull request #1104 from nikman-ru:cap_reuse
This commit is contained in:
commit
75b86c9706
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user