qedit: Remove the splitter from the graph if it failed to connect.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Gabriel Ivăncescu 2020-04-23 14:45:45 -05:00 committed by Alexandre Julliard
parent 2e6f5e6784
commit 4d94e773fc
1 changed files with 5 additions and 8 deletions

View File

@ -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);
}