And also unref events if the basetransform subclass has no
event handler and the event is not forwarded at all.
gboolean result = FALSE;
src = GST_BASE_SRC (gst_pad_get_parent (pad));
- if (G_UNLIKELY (src == NULL))
+ if (G_UNLIKELY (src == NULL)) {
+ gst_event_unref (event);
return FALSE;
+ }
+
bclass = GST_BASE_SRC_GET_CLASS (src);
if (bclass->event) {
gboolean ret = TRUE;
trans = GST_BASE_TRANSFORM (gst_pad_get_parent (pad));
- if (G_UNLIKELY (trans == NULL))
+ if (G_UNLIKELY (trans == NULL)) {
+ gst_event_unref (event);
return FALSE;
+ }
bclass = GST_BASE_TRANSFORM_GET_CLASS (trans);
if (bclass->src_event)
ret = bclass->src_event (trans, event);
+ else
+ gst_event_unref (event);
gst_object_unref (trans);