rtpptdemux: forward sticky events and then set caps
authorPaul HENRYS <visechelle@gmail.com>
Tue, 29 Jan 2013 09:48:17 +0000 (10:48 +0100)
committerWim Taymans <wim.taymans@collabora.co.uk>
Thu, 7 Feb 2013 13:38:20 +0000 (14:38 +0100)
When a new src pad is added, first forward the sticky events and then
set the caps on the src pad

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=692786

gst/rtpmanager/gstrtpptdemux.c

index 1dc7330..e0ae78b 100644 (file)
@@ -394,13 +394,16 @@ gst_rtp_pt_demux_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
 
     gst_pad_set_active (srcpad, TRUE);
 
+    /* First sticky events on sink pad are forwarded to the new src pad */
+    gst_pad_sticky_events_foreach (rtpdemux->sink, forward_sticky_events,
+        srcpad);
+
+    /* Then caps event is sent */
     caps = gst_caps_make_writable (caps);
     gst_caps_set_simple (caps, "payload", G_TYPE_INT, pt, NULL);
     gst_pad_set_caps (srcpad, caps);
     gst_caps_unref (caps);
 
-    gst_pad_sticky_events_foreach (rtpdemux->sink, forward_sticky_events,
-        srcpad);
     gst_element_add_pad (GST_ELEMENT_CAST (rtpdemux), srcpad);
 
     GST_DEBUG ("emitting new-payload-type for pt %d", pt);