summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2012-01-29 18:01:05 +0000
committerOlivier CrĂȘte <olivier.crete@collabora.com>2012-01-29 18:03:53 +0000
commit70539e9c9373375f81290901417c238b860c1093 (patch)
treea7ade6b262234f02f918b21eeec160aca0dcda91 /gst
parent3cccb06dc3fe146dc2b9f310ae5fcc236b3d7d0a (diff)
downloadgstreamer-plugins-bad-70539e9c9373375f81290901417c238b860c1093.tar.gz
rtpmux: Unref non-forwarded events
Also, don't unref forwarded ones
Diffstat (limited to 'gst')
-rw-r--r--gst/rtpmux/gstrtpmux.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/gst/rtpmux/gstrtpmux.c b/gst/rtpmux/gstrtpmux.c
index 49964d5a6..253f463fd 100644
--- a/gst/rtpmux/gstrtpmux.c
+++ b/gst/rtpmux/gstrtpmux.c
@@ -754,6 +754,7 @@ gst_rtp_mux_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
{
GstRTPMux *mux = GST_RTP_MUX (parent);
gboolean is_pad;
+ gboolean ret;
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_CAPS:
@@ -761,7 +762,9 @@ gst_rtp_mux_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
GstCaps *caps;
gst_event_parse_caps (event, &caps);
- return gst_rtp_mux_setcaps (pad, mux, caps);
+ ret = gst_rtp_mux_setcaps (pad, mux, caps);
+ gst_event_unref (event);
+ return ret;
}
case GST_EVENT_FLUSH_STOP:
{
@@ -781,7 +784,6 @@ gst_rtp_mux_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
gst_event_copy_segment (event, &padpriv->segment);
}
GST_OBJECT_UNLOCK (mux);
- gst_event_unref (event);
break;
}
default:
@@ -792,10 +794,12 @@ gst_rtp_mux_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
is_pad = (pad == mux->last_pad);
GST_OBJECT_UNLOCK (mux);
- if (is_pad)
+ if (is_pad) {
return gst_pad_push_event (mux->srcpad, event);
- else
+ } else {
+ gst_event_unref (event);
return TRUE;
+ }
}
static void