urisourcebin: Propagate sticky events from parsebin
authorEdward Hervey <edward@centricular.com>
Fri, 17 Mar 2023 08:58:55 +0000 (09:58 +0100)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Sat, 18 Mar 2023 06:47:21 +0000 (06:47 +0000)
If sticky events are present on parsebin source pads, we propagate them to the
multiqueue source pads. Those will be propagated on the new urisourcebin source
pads like in the other code paths.

This ensures that STREAM_START event are present on new source pads. If CAPS
event are also present (not guaranteed), they will also be available.

Fixes #2384

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

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

index 9a78c3d..d612935 100644 (file)
@@ -663,7 +663,9 @@ copy_sticky_events (GstPad * pad, GstEvent ** event, gpointer user_data)
 {
   GstPad *gpad = GST_PAD_CAST (user_data);
 
-  GST_DEBUG_OBJECT (gpad, "store sticky event %" GST_PTR_FORMAT, *event);
+  GST_DEBUG_OBJECT (gpad,
+      "store sticky event from %" GST_PTR_FORMAT " %" GST_PTR_FORMAT, pad,
+      *event);
   gst_pad_store_sticky_event (gpad, *event);
 
   return TRUE;
@@ -1125,6 +1127,7 @@ new_output_slot (ChildSrcPadInfo * info, GstPad * originating_pad)
     slot->queue_sinkpad =
         gst_element_request_pad_simple (info->multiqueue, "sink_%u");
     srcpad = gst_pad_get_single_internal_link (slot->queue_sinkpad);
+    gst_pad_sticky_events_foreach (originating_pad, copy_sticky_events, srcpad);
     slot->output_pad = create_output_pad (slot, srcpad);
     gst_object_unref (srcpad);
     gst_pad_link (originating_pad, slot->queue_sinkpad);