Zebediah Figura : quartz/filtergraph: Don' t recursively render pins whose names begin with ~.

Alexandre Julliard julliard at winehq.org
Fri Sep 21 17:04:31 CDT 2018


Module: wine
Branch: master
Commit: 42929b75fce15e79de472b3379acb9fd9b26e24e
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=42929b75fce15e79de472b3379acb9fd9b26e24e

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Thu Sep 20 23:34:14 2018 -0500

quartz/filtergraph: Don't recursively render pins whose names begin with ~.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/quartz/filtergraph.c       | 16 +++++++++++-----
 dlls/quartz/tests/filtergraph.c | 28 ++++++++++++++++++++++++++++
 2 files changed, 39 insertions(+), 5 deletions(-)

diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c
index 969cbec..4f3e0a7 100644
--- a/dlls/quartz/filtergraph.c
+++ b/dlls/quartz/filtergraph.c
@@ -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;
diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c
index 30bf0cc..6c8b9fa 100644
--- a/dlls/quartz/tests/filtergraph.c
+++ b/dlls/quartz/tests/filtergraph.c
@@ -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);




More information about the wine-cvs mailing list