quartz: Get the CLSID directly from the filter.

This commit is contained in:
Alessandro Pignotti 2013-02-24 23:21:48 +01:00 committed by Alexandre Julliard
parent 1ebed65e92
commit 3271406502
1 changed files with 15 additions and 7 deletions

View File

@ -1025,14 +1025,28 @@ static HRESULT WINAPI FilterGraph2_Connect(IFilterGraph2 *iface, IPin *ppinOut,
IAMGraphBuilderCallback *callback = NULL;
hr = GetFilterInfo(pMoniker, &clsid, &var);
IMoniker_Release(pMoniker);
if (FAILED(hr)) {
WARN("Unable to retrieve filter info (%x)\n", hr);
goto error;
}
hr = IMoniker_BindToObject(pMoniker, NULL, NULL, &IID_IBaseFilter, (LPVOID*)&pfilter);
IMoniker_Release(pMoniker);
if (FAILED(hr)) {
WARN("Unable to create filter (%x), trying next one\n", hr);
goto error;
}
hr = IBaseFilter_GetClassID(pfilter, &clsid);
if (FAILED(hr))
{
IBaseFilter_Release(pfilter);
goto error;
}
if (IsEqualGUID(&clsid, &FilterCLSID)) {
/* Skip filter (same as the one the output pin belongs to) */
IBaseFilter_Release(pfilter);
goto error;
}
@ -1052,12 +1066,6 @@ static HRESULT WINAPI FilterGraph2_Connect(IFilterGraph2 *iface, IPin *ppinOut,
}
}
hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter, (LPVOID*)&pfilter);
if (FAILED(hr)) {
WARN("Unable to create filter (%x), trying next one\n", hr);
goto error;
}
if (callback)
{
HRESULT rc;