From 3271406502115910454d1838570e9d13daa71bc8 Mon Sep 17 00:00:00 2001 From: Alessandro Pignotti Date: Sun, 24 Feb 2013 23:21:48 +0100 Subject: [PATCH] quartz: Get the CLSID directly from the filter. --- dlls/quartz/filtergraph.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index acd6dcac5f0..6b53d723b8f 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -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;