Commit 14ba79ec authored by Maarten Lankhorst's avatar Maarten Lankhorst Committed by Alexandre Julliard

quartz: Fix IFilterGraph RemoveFilter to stop the filter before removing it.

Also checks for VFW_E_NOT_STOPPED that is allowed to cause a disconnection to fail.
parent d47bdbfb
......@@ -448,12 +448,31 @@ static HRESULT WINAPI FilterGraph2_RemoveFilter(IFilterGraph2 *iface,
if (This->ppFiltersInGraph[i] == pFilter)
{
IEnumPins *penumpins;
IBaseFilter_Stop(pFilter);
hr = IBaseFilter_EnumPins(pFilter, &penumpins);
if (SUCCEEDED(hr)) {
IPin *ppin;
while(IEnumPins_Next(penumpins, 1, &ppin, NULL) == S_OK) {
IPin_Disconnect(ppin);
IPin_Release(ppin);
IPin *victim = NULL;
HRESULT h;
IPin_ConnectedTo(ppin, &victim);
if (victim)
{
h = IPin_Disconnect(victim);
TRACE("Disconnect other side: %08x\n", h);
if (h == VFW_E_NOT_STOPPED)
{
PIN_INFO pinfo;
IPin_QueryPinInfo(victim, &pinfo);
IBaseFilter_Stop(pinfo.pFilter);
IBaseFilter_Release(pinfo.pFilter);
h = IPin_Disconnect(victim);
TRACE("Disconnect retry: %08x\n", h);
}
IPin_Release(victim);
}
h = IPin_Disconnect(ppin);
TRACE("Disconnect 2: %08x\n", h);
}
IEnumPins_Release(penumpins);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment