qedit: Try all possible splitter filters instead of only the first one.
This commit is contained in:
parent
09849ed929
commit
b769a266cf
|
@ -378,37 +378,32 @@ static HRESULT GetSplitter(MediaDetImpl *This)
|
|||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
hr = IEnumMoniker_Next(filters, 1, &mon, NULL);
|
||||
IEnumMoniker_Release(filters);
|
||||
if (hr != S_OK) /* No matches, what do we do? */
|
||||
return E_NOINTERFACE;
|
||||
|
||||
hr = E_NOINTERFACE;
|
||||
while (IEnumMoniker_Next(filters, 1, &mon, NULL) == S_OK)
|
||||
{
|
||||
hr = GetFilterInfo(mon, &clsid, &var);
|
||||
IMoniker_Release(mon);
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
continue;
|
||||
|
||||
hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER,
|
||||
&IID_IBaseFilter, (void **) &splitter);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
VariantClear(&var);
|
||||
return hr;
|
||||
goto retry;
|
||||
}
|
||||
|
||||
hr = IGraphBuilder_AddFilter(This->graph, splitter,
|
||||
V_UNION(&var, bstrVal));
|
||||
VariantClear(&var);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
IBaseFilter_Release(splitter);
|
||||
return hr;
|
||||
}
|
||||
This->splitter = splitter;
|
||||
if (FAILED(hr))
|
||||
goto retry;
|
||||
|
||||
hr = IBaseFilter_EnumPins(This->source, &pins);
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
goto retry;
|
||||
IEnumPins_Next(pins, 1, &source_pin, NULL);
|
||||
IEnumPins_Release(pins);
|
||||
|
||||
|
@ -416,7 +411,7 @@ static HRESULT GetSplitter(MediaDetImpl *This)
|
|||
if (FAILED(hr))
|
||||
{
|
||||
IPin_Release(source_pin);
|
||||
return hr;
|
||||
goto retry;
|
||||
}
|
||||
IEnumPins_Next(pins, 1, &splitter_pin, NULL);
|
||||
IEnumPins_Release(pins);
|
||||
|
@ -424,6 +419,15 @@ static HRESULT GetSplitter(MediaDetImpl *This)
|
|||
hr = IPin_Connect(source_pin, splitter_pin, NULL);
|
||||
IPin_Release(source_pin);
|
||||
IPin_Release(splitter_pin);
|
||||
if (SUCCEEDED(hr))
|
||||
break;
|
||||
|
||||
retry:
|
||||
IBaseFilter_Release(splitter);
|
||||
This->splitter = NULL;
|
||||
}
|
||||
|
||||
IEnumMoniker_Release(filters);
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
|
|
Loading…
Reference in New Issue