Commit 7e1b714f authored by Lei Zhang's avatar Lei Zhang Committed by Alexandre Julliard

quartz: Enumerate all the pins on filter and check directions when rendering.

parent db5d8a2b
...@@ -1318,7 +1318,7 @@ static HRESULT WINAPI FilterGraph2_Render(IFilterGraph2 *iface, IPin *ppinOut) ...@@ -1318,7 +1318,7 @@ static HRESULT WINAPI FilterGraph2_Render(IFilterGraph2 *iface, IPin *ppinOut)
GUID clsid; GUID clsid;
IPin* ppinfilter; IPin* ppinfilter;
IBaseFilter* pfilter = NULL; IBaseFilter* pfilter = NULL;
IEnumPins* penumpins; IEnumPins* penumpins = NULL;
ULONG pin; ULONG pin;
hr = GetFilterInfo(pMoniker, &clsid, &var); hr = GetFilterInfo(pMoniker, &clsid, &var);
...@@ -1348,18 +1348,28 @@ static HRESULT WINAPI FilterGraph2_Render(IFilterGraph2 *iface, IPin *ppinOut) ...@@ -1348,18 +1348,28 @@ static HRESULT WINAPI FilterGraph2_Render(IFilterGraph2 *iface, IPin *ppinOut)
WARN("Splitter Enumpins (%x)\n", hr); WARN("Splitter Enumpins (%x)\n", hr);
goto error; goto error;
} }
hr = IEnumPins_Next(penumpins, 1, &ppinfilter, &pin);
IEnumPins_Release(penumpins); while ((hr = IEnumPins_Next(penumpins, 1, &ppinfilter, &pin)) == S_OK)
if (FAILED(hr)) { {
WARN("Next (%x)\n", hr); PIN_DIRECTION dir;
goto error;
}
if (pin == 0) { if (pin == 0) {
WARN("No Pin\n"); WARN("No Pin\n");
hr = E_FAIL; hr = E_FAIL;
goto error; goto error;
} }
hr = IPin_QueryDirection(ppinfilter, &dir);
if (FAILED(hr)) {
IPin_Release(ppinfilter);
WARN("QueryDirection failed (%x)\n", hr);
goto error;
}
if (dir != PINDIR_INPUT) {
IPin_Release(ppinfilter);
continue; /* Wrong direction */
}
/* Connect the pin to the "Renderer" */ /* Connect the pin to the "Renderer" */
hr = IPin_Connect(ppinOut, ppinfilter, NULL); hr = IPin_Connect(ppinOut, ppinfilter, NULL);
IPin_Release(ppinfilter); IPin_Release(ppinfilter);
...@@ -1379,9 +1389,20 @@ static HRESULT WINAPI FilterGraph2_Render(IFilterGraph2 *iface, IPin *ppinOut) ...@@ -1379,9 +1389,20 @@ static HRESULT WINAPI FilterGraph2_Render(IFilterGraph2 *iface, IPin *ppinOut)
} }
IBaseFilter_Release(pfilter); IBaseFilter_Release(pfilter);
break; break;
}
if (SUCCEEDED(hr)) {
IEnumPins_Release(penumpins);
break; /* out of IEnumMoniker_Next loop */
}
/* IEnumPins_Next failed, all other failure case caught by goto error */
WARN("IEnumPins_Next (%x)\n", hr);
/* goto error */
error: error:
VariantClear(&var); VariantClear(&var);
if (penumpins)
IEnumPins_Release(penumpins);
if (pfilter) { if (pfilter) {
IFilterGraph2_RemoveFilter(iface, pfilter); IFilterGraph2_RemoveFilter(iface, pfilter);
IBaseFilter_Release(pfilter); IBaseFilter_Release(pfilter);
......
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