segmentclip: Keep a reference of events until the event is parsed

This commit is contained in:
Sebastian Dröge 2011-04-01 15:00:32 +02:00
parent b2c90da38e
commit 7858d65b4a

View file

@ -271,7 +271,7 @@ gst_segment_clip_event (GstPad * pad, GstEvent * event)
GST_LOG_OBJECT (pad, "Got %s event", GST_EVENT_TYPE_NAME (event)); GST_LOG_OBJECT (pad, "Got %s event", GST_EVENT_TYPE_NAME (event));
otherpad = (pad == self->srcpad) ? self->sinkpad : self->srcpad; otherpad = (pad == self->srcpad) ? self->sinkpad : self->srcpad;
ret = gst_pad_push_event (otherpad, event); ret = gst_pad_push_event (otherpad, gst_event_ref (event));
if (ret) { if (ret) {
switch (GST_EVENT_TYPE (event)) { switch (GST_EVENT_TYPE (event)) {
@ -300,6 +300,8 @@ gst_segment_clip_event (GstPad * pad, GstEvent * event)
} }
} }
gst_event_unref (event);
gst_object_unref (self); gst_object_unref (self);
return ret; return ret;
} }