pad: Set the event source object if none is set yet in gst_pad_push_event()
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Mon, 1 Nov 2010 15:34:46 +0000 (16:34 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Thu, 2 Dec 2010 18:02:08 +0000 (19:02 +0100)
Otherwise the source will stay at NULL, the event is passed to the
peerpad via gst_pad_send_event() and then the peerpad is set as
source of the event instead of the originating pad.

gst/gstpad.c

index bd36a19..6a19578 100644 (file)
@@ -4954,6 +4954,11 @@ gst_pad_push_event (GstPad * pad, GstEvent * event)
       break;
   }
 
+  if (G_UNLIKELY (GST_EVENT_SRC (event) == NULL)) {
+    GST_LOG_OBJECT (pad, "event had no source, setting pad as event source");
+    GST_EVENT_SRC (event) = gst_object_ref (pad);
+  }
+
   if (G_UNLIKELY (GST_PAD_DO_EVENT_SIGNALS (pad) > 0)) {
     GST_OBJECT_UNLOCK (pad);