quartz/filtergraph: Don't recursively render pins whose names begin with ~.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
c1af822758
commit
42929b75fc
|
@ -1367,16 +1367,22 @@ static HRESULT render_output_pins(IFilterGraphImpl *graph, IBaseFilter *filter)
|
|||
BOOL renderall = TRUE;
|
||||
IEnumPins *enumpins;
|
||||
IPin *pin, *peer;
|
||||
PIN_INFO info;
|
||||
|
||||
IBaseFilter_EnumPins(filter, &enumpins);
|
||||
while (IEnumPins_Next(enumpins, 1, &pin, NULL) == S_OK)
|
||||
{
|
||||
PIN_DIRECTION dir = PINDIR_INPUT;
|
||||
|
||||
IPin_QueryDirection(pin, &dir);
|
||||
|
||||
if (dir == PINDIR_OUTPUT)
|
||||
IPin_QueryPinInfo(pin, &info);
|
||||
IBaseFilter_Release(info.pFilter);
|
||||
if (info.dir == PINDIR_OUTPUT)
|
||||
{
|
||||
if (info.achName[0] == '~')
|
||||
{
|
||||
TRACE("Skipping non-rendered pin %s.\n", debugstr_w(info.achName));
|
||||
IPin_Release(pin);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (IPin_ConnectedTo(pin, &peer) == VFW_E_NOT_CONNECTED)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
|
|
@ -1485,6 +1485,8 @@ static void test_graph_builder_render(void)
|
|||
ok(parser_pins[1].peer == &sink1_pin.IPin_iface, "Got peer %p.\n", parser_pins[1].peer);
|
||||
IFilterGraph2_Disconnect(graph, source_pin.peer);
|
||||
IFilterGraph2_Disconnect(graph, &source_pin.IPin_iface);
|
||||
IFilterGraph2_Disconnect(graph, parser_pins[0].peer);
|
||||
IFilterGraph2_Disconnect(graph, &parser_pins[0].IPin_iface);
|
||||
|
||||
IFilterGraph2_RemoveFilter(graph, &sink1.IBaseFilter_iface);
|
||||
IFilterGraph2_AddFilter(graph, &sink1.IBaseFilter_iface, NULL);
|
||||
|
@ -1492,6 +1494,32 @@ static void test_graph_builder_render(void)
|
|||
hr = IFilterGraph2_Render(graph, &source_pin.IPin_iface);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(source_pin.peer == &sink1_pin.IPin_iface, "Got peer %p.\n", source_pin.peer);
|
||||
IFilterGraph2_Disconnect(graph, source_pin.peer);
|
||||
IFilterGraph2_Disconnect(graph, &source_pin.IPin_iface);
|
||||
|
||||
/* A pin whose name (not ID) begins with a tilde is not rendered. */
|
||||
|
||||
IFilterGraph2_RemoveFilter(graph, &sink2.IBaseFilter_iface);
|
||||
IFilterGraph2_RemoveFilter(graph, &parser.IBaseFilter_iface);
|
||||
IFilterGraph2_AddFilter(graph, &parser.IBaseFilter_iface, NULL);
|
||||
|
||||
parser_pins[1].name[0] = '~';
|
||||
hr = IFilterGraph2_Render(graph, &source_pin.IPin_iface);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(source_pin.peer == &parser_pins[0].IPin_iface, "Got peer %p.\n", source_pin.peer);
|
||||
ok(!parser_pins[1].peer, "Got peer %p.\n", parser_pins[1].peer);
|
||||
ok(!sink1_pin.peer, "Got peer %p.\n", sink1_pin.peer);
|
||||
IFilterGraph2_Disconnect(graph, source_pin.peer);
|
||||
IFilterGraph2_Disconnect(graph, &source_pin.IPin_iface);
|
||||
|
||||
parser_pins[1].name[0] = 0;
|
||||
parser_pins[1].id[0] = '~';
|
||||
hr = IFilterGraph2_Render(graph, &source_pin.IPin_iface);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(source_pin.peer == &parser_pins[0].IPin_iface, "Got peer %p.\n", source_pin.peer);
|
||||
ok(parser_pins[1].peer == &sink1_pin.IPin_iface, "Got peer %p.\n", parser_pins[1].peer);
|
||||
IFilterGraph2_Disconnect(graph, source_pin.peer);
|
||||
IFilterGraph2_Disconnect(graph, &source_pin.IPin_iface);
|
||||
|
||||
ref = IFilterGraph2_Release(graph);
|
||||
ok(!ref, "Got outstanding refcount %d.\n", ref);
|
||||
|
|
Loading…
Reference in New Issue