|
From: libvidcap c. m. <lib...@li...> - 2007-09-24 18:50:14
|
Revision: 29
http://libvidcap.svn.sourceforge.net/libvidcap/?rev=29&view=rev
Author: bcholew
Date: 2007-09-24 11:49:27 -0700 (Mon, 24 Sep 2007)
Log Message:
-----------
Only clear graphIsSetup_ flag if RemoveFilter() succeeds. If couldn't remove sample grabber because graph wasn't actually stopped, send the stop request. This could happen in cases of rapid start/stop requests.
Modified Paths:
--------------
trunk/src/directshow/DirectShowSource.cpp
Modified: trunk/src/directshow/DirectShowSource.cpp
===================================================================
--- trunk/src/directshow/DirectShowSource.cpp 2007-09-24 12:38:15 UTC (rev 28)
+++ trunk/src/directshow/DirectShowSource.cpp 2007-09-24 18:49:27 UTC (rev 29)
@@ -485,16 +485,26 @@
{
if ( graphIsSetup_ )
{
- graphIsSetup_ = false;
-
// necessary to allow subsequent calls to RenderStream()
// (like after rebinding) to succeed
HRESULT hr = pFilterGraph_->RemoveFilter(pSampleGrabber_);
if ( FAILED(hr) )
{
log_error("failed to remove Sample Grabber (%d)\n", hr);
+ if ( hr == VFW_E_NOT_STOPPED )
+ {
+ log_error("Capture wasn't stopped. "
+ "Repeating STOP request...\n");
+ stop();
+ }
+ else
+ {
+ log_error("not processing removal failure\n");
+ }
return 1;
}
+
+ graphIsSetup_ = false;
}
return 0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|