encodebasebin: Fix parser cleanup
authorPhilippe Normand <philn@igalia.com>
Tue, 15 Oct 2024 14:57:06 +0000 (15:57 +0100)
committerBackport Bot <gitlab-backport-bot@gstreamer-foundation.org>
Sat, 26 Oct 2024 10:56:23 +0000 (11:56 +0100)
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>

subprojects/gst-plugins-base/gst/encoding/gstencodebasebin.c

index 52f0a20e051d1653a055c8b6a04a32ba8ac4f79d..1d64d4d34c3a464b05ffa6c2fd0f8758ece8d053 100644 (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);
   }