decodebin3: Free pending events on input pads when unlinking
authorEdward Hervey <edward@centricular.com>
Thu, 3 Oct 2024 15:05:15 +0000 (17:05 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Fri, 18 Oct 2024 10:13:13 +0000 (10:13 +0000)
Otherwise we could end up with *old* events leaking through on the next linking.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7682>

subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c

index 10ebc764ffead6ad645e900552465491da008c50..b2311ea4d30b5436ad0dd5fb9abe314095619c03 100644 (file)
@@ -1824,6 +1824,11 @@ gst_decodebin3_input_pad_unlink (GstPad * pad, GstPad * peer,
     GST_DEBUG_OBJECT (dbin, "Resetting parsebin since it's pull-based");
     gst_decodebin_input_reset_parsebin (dbin, input);
   }
+
+  g_list_free_full (input->events_waiting_for_collection,
+      (GDestroyNotify) gst_event_unref);
+  input->events_waiting_for_collection = NULL;
+
   /* In all cases we will be receiving new stream-start and data */
   input->group_id = GST_GROUP_ID_INVALID;
   input->drained = FALSE;