From 763fc7cf3a48709473090f3c53f03217b4e56344 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 17 Feb 2007 23:55:20 -0800 Subject: [PATCH] quartz: Make sure the splitter has output plugins before trying to render them. --- dlls/quartz/filtergraph.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index ebda643ee1a..8b38a3b562e 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);