From f2f7842f6b7d1d43f9606a8fb46816e1a56c2010 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 1 Nov 2010 16:34:46 +0100 Subject: [PATCH] pad: Set the event source object if none is set yet in gst_pad_push_event() 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 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gst/gstpad.c b/gst/gstpad.c index bd36a190c9..6a19578319 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -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);