mirror of
https://github.com/opencv/opencv.git
synced 2024-11-28 05:06:29 +08:00
Merge pull request #11164 from corleypc:master
This commit is contained in:
commit
00fff3a85d
@ -2912,7 +2912,7 @@ HRESULT videoInput::getDevice(IBaseFilter** gottaFilter, int deviceId, WCHAR * w
|
||||
// Enumerate the monikers.
|
||||
IMoniker *pMoniker = NULL;
|
||||
ULONG cFetched;
|
||||
while ((pEnumCat->Next(1, &pMoniker, &cFetched) == S_OK) && (!done))
|
||||
while ((!done) && (pEnumCat->Next(1, &pMoniker, &cFetched) == S_OK))
|
||||
{
|
||||
if(deviceCounter == deviceId)
|
||||
{
|
||||
@ -2951,6 +2951,12 @@ HRESULT videoInput::getDevice(IBaseFilter** gottaFilter, int deviceId, WCHAR * w
|
||||
pMoniker = NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// cleaning for the case when this isn't the device we are looking for
|
||||
pMoniker->Release();
|
||||
pMoniker = NULL;
|
||||
}
|
||||
deviceCounter++;
|
||||
}
|
||||
pEnumCat->Release();
|
||||
|
Loading…
Reference in New Issue
Block a user