|
From: libvidcap c. <lib...@li...> - 2007-12-03 14:11:20
|
Revision: 74
http://libvidcap.svn.sourceforge.net/libvidcap/?rev=74&view=rev
Author: bcholew
Date: 2007-12-03 06:11:12 -0800 (Mon, 03 Dec 2007)
Log Message:
-----------
Improve cleanup when can't create enumerator moniker. This prevents bad things from happening when the last vidcap device is removed.
Modified Paths:
--------------
trunk/src/directshow/DShowSrcManager.cpp
Modified: trunk/src/directshow/DShowSrcManager.cpp
===================================================================
--- trunk/src/directshow/DShowSrcManager.cpp 2007-12-03 14:09:55 UTC (rev 73)
+++ trunk/src/directshow/DShowSrcManager.cpp 2007-12-03 14:11:12 UTC (rev 74)
@@ -100,7 +100,8 @@
if ( !pCreateDevEnum )
{
log_error("failed creating device enumerator - to scan\n");
- return -1;
+ srcList->len = newListLen;
+ return 0;
}
// Enumerate video capture devices
@@ -112,7 +113,8 @@
if ( !pEm )
{
log_error("Failed creating enumerator moniker\n");
- return -1;
+ srcList->len = newListLen;
+ return 0;
}
pEm->Reset();
@@ -128,7 +130,9 @@
if ( FAILED(hr) )
{
log_error("failed CreateBindCtx\n");
- return -1;
+ pM->Release();
+ srcList->len = newListLen;
+ return srcList->len;
}
IBaseFilter * pCaptureFilter = 0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|