提交 67b67003 编写于 作者: V Vitaly Tuzov

Disable MSMF VideoCapture fallback to existing camera in case provided index is out of range.

上级 b80c7bca
......@@ -854,7 +854,8 @@ bool CvCapture_MSMF::configureOutput(UINT32 width, UINT32 height, double prefFra
bool CvCapture_MSMF::open(int _index)
{
close();
if (_index < 0)
return false;
_ComPtr<IMFAttributes> msAttr = NULL;
if (SUCCEEDED(MFCreateAttributes(&msAttr, 1)) &&
SUCCEEDED(msAttr->SetGUID(
......@@ -868,7 +869,6 @@ bool CvCapture_MSMF::open(int _index)
{
if (count > 0)
{
_index = std::min(std::max(0, _index), (int)count - 1);
for (int ind = 0; ind < (int)count; ind++)
{
if (ind == _index && ppDevices[ind])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册