Commit 98b2d775 authored by Seungha Yang's avatar Seungha Yang 🐑 Committed by Thibault Saunier
Browse files

nleghostpad: Fix GstEvent leak

parent 783aba17
......@@ -2723,7 +2723,8 @@ _relink_single_node (NleComposition * comp, GNode * node,
gst_bin_add (GST_BIN (comp->priv->current_bin), GST_ELEMENT (newobj));
gst_element_sync_state_with_parent (GST_ELEMENT_CAST (newobj));
translated_seek = nle_object_translate_incoming_seek (newobj, toplevel_seek);
translated_seek = nle_object_translate_incoming_seek (newobj,
gst_event_ref (toplevel_seek));
gst_element_send_event (GST_ELEMENT (newobj), translated_seek);
......
......@@ -39,6 +39,13 @@ struct _NlePadPrivate
GstEvent *pending_seek;
};
/**
* nle_object_translate_incoming_seek:
* @object: A #NleObject.
* @event: (transfer full) A #GstEvent to translate
*
* Returns: (transfer full) new translated seek event
*/
GstEvent *
nle_object_translate_incoming_seek (NleObject * object, GstEvent * event)
{
......@@ -119,6 +126,7 @@ nle_object_translate_incoming_seek (NleObject * object, GstEvent * event)
event2 = gst_event_new_seek (rate, GST_FORMAT_TIME, flags,
ncurtype, (gint64) ncur, GST_SEEK_TYPE_SET, (gint64) nstop);
GST_EVENT_SEQNUM (event2) = seqnum;
gst_event_unref (event);
return event2;
......@@ -486,6 +494,7 @@ ghostpad_event_function (GstPad * ghostpad, GstObject * parent,
if (!(target = gst_ghost_pad_get_target (GST_GHOST_PAD (ghostpad)))) {
g_assert ("Seeked a pad with not target SHOULD NOT HAPPEND");
ret = FALSE;
gst_event_unref (event);
event = NULL;
} else {
gst_object_unref (target);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment