From 4d94e773fc0ca95526df3270c9899439c13a54fc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gabriel=20Iv=C4=83ncescu?= Date: Thu, 23 Apr 2020 14:45:45 -0500 Subject: [PATCH] qedit: Remove the splitter from the graph if it failed to connect. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu Signed-off-by: Zebediah Figura Signed-off-by: Alexandre Julliard --- dlls/qedit/mediadet.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/dlls/qedit/mediadet.c b/dlls/qedit/mediadet.c index d63825c6290..eb7a51928b9 100644 --- a/dlls/qedit/mediadet.c +++ b/dlls/qedit/mediadet.c @@ -193,17 +193,12 @@ static HRESULT find_splitter(MediaDetImpl *detector) hr = IBaseFilter_EnumPins(splitter, &enum_pins); if (FAILED(hr)) - { - IBaseFilter_Release(splitter); - continue; - } + goto next; + hr = IEnumPins_Next(enum_pins, 1, &splitter_pin, NULL); IEnumPins_Release(enum_pins); if (FAILED(hr)) - { - IBaseFilter_Release(splitter); - continue; - } + goto next; hr = IPin_Connect(source_pin, splitter_pin, NULL); IPin_Release(splitter_pin); @@ -213,6 +208,8 @@ static HRESULT find_splitter(MediaDetImpl *detector) break; } +next: + IGraphBuilder_RemoveFilter(detector->graph, splitter); IBaseFilter_Release(splitter); } -- 2.11.4.GIT