[1/2] quartz: Make sure the splitter has output plugins before trying to render them

Chris Robinson chris.kcat at gmail.com
Sun Feb 18 01:55:20 CST 2007


-------------- next part --------------
From 9d96c66bb670a375a889bee03b771a237285a6f6 Mon Sep 17 00:00:00 2001
From: Chris Robinson <chris.kcat at gmail.com>
Date: Wed, 14 Feb 2007 07:10:33 -0800
Subject: [PATCH] quartz: Make sure the splitter has output plugins before trying to render them

---
 dlls/quartz/filtergraph.c |   22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c
index ebda643..8b38a3b 100644
--- a/dlls/quartz/filtergraph.c
+++ b/dlls/quartz/filtergraph.c
@@ -1057,20 +1057,26 @@ static HRESULT WINAPI GraphBuilder_RenderFile(IGraphBuilder *iface,
         IEnumPins_Release(penumpins);
 
         hr = IPin_Connect(ppinreader, ppinsplitter, NULL);
-        if (FAILED(hr)) {
+        if (SUCCEEDED(hr)) {
+            /* Make sure there's some output pins in the filter */
+            hr = GetInternalConnections(psplitter, ppinsplitter, &ppins, &nb);
+            if(SUCCEEDED(hr)) {
+                if(nb > 0) {
+                    TRACE("Successfully connected to filter\n");
+                    break;
+                }
+                CoTaskMemFree(ppins);
+                ppins = NULL;
+                TRACE("No output pins found in filter\n");
+            }
             IBaseFilter_Release(ppinsplitter);
             ppinsplitter = NULL;
-            TRACE("Cannot connect to filter (%x), trying next one\n", hr);
-            continue;
         }
-        TRACE("Successfully connected to filter\n");
-        break;
+        TRACE("Cannot connect to filter (%x), trying next one\n", hr);
+        hr = E_FAIL;
     }
 
     /* Render all output pin of the splitter by calling IGraphBuilder_Render on each of them */
-    if (SUCCEEDED(hr))
-        hr = GetInternalConnections(psplitter, ppinsplitter, &ppins, &nb);
-    
     if (SUCCEEDED(hr)) {
         int i;
         TRACE("pins to consider: %d\n", nb);
-- 
1.4.4.4



More information about the wine-patches mailing list