encodebasebin: Fix parser cleanup

When removing the parser from the stream group, it might not be linked to a
combiner so this needs to be checked.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7756>
This commit is contained in:
Philippe Normand 2024-10-15 15:57:06 +01:00 committed by Backport Bot
parent 7e89aa7bdf
commit 31a697dd06

View file

@ -2428,7 +2428,9 @@ stream_group_free (GstEncodeBaseBin * ebin, StreamGroup * sgroup)
if (sgroup->parser) {
gst_element_set_state (sgroup->parser, GST_STATE_NULL);
gst_element_unlink (sgroup->parser, sgroup->outfilter);
gst_element_unlink (sgroup->combiner, sgroup->parser);
if (sgroup->combiner) {
gst_element_unlink (sgroup->combiner, sgroup->parser);
}
gst_bin_remove ((GstBin *) ebin, sgroup->parser);
}