mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-31 11:32:38 +00:00
base: Unref events if the parent element disappeared
And also unref events if the basetransform subclass has no event handler and the event is not forwarded at all.
This commit is contained in:
parent
0daedb7409
commit
237e54d4fe
2 changed files with 9 additions and 2 deletions
|
@ -1759,8 +1759,11 @@ gst_base_src_event_handler (GstPad * pad, GstEvent * event)
|
|||
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) {
|
||||
|
|
|
@ -2085,13 +2085,17 @@ gst_base_transform_src_event (GstPad * pad, GstEvent * 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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue