rtp: Unref events if the parent element disappeared

This commit is contained in:
Sebastian Dröge 2011-04-08 15:20:51 +02:00
parent 046f170d6a
commit 31af4fe33e
4 changed files with 19 additions and 5 deletions

View file

@ -1008,8 +1008,10 @@ gst_rtp_jitter_buffer_src_event (GstPad * pad, GstEvent * event)
GstRtpJitterBufferPrivate *priv;
jitterbuffer = GST_RTP_JITTER_BUFFER (gst_pad_get_parent (pad));
if (G_UNLIKELY (jitterbuffer == NULL))
if (G_UNLIKELY (jitterbuffer == NULL)) {
gst_event_unref (event);
return FALSE;
}
priv = jitterbuffer->priv;
GST_DEBUG_OBJECT (jitterbuffer, "received %s", GST_EVENT_TYPE_NAME (event));

View file

@ -434,8 +434,10 @@ gst_rtp_pt_demux_sink_event (GstPad * pad, GstEvent * event)
gboolean res = FALSE;
rtpdemux = GST_RTP_PT_DEMUX (gst_pad_get_parent (pad));
if (G_UNLIKELY (rtpdemux == NULL))
if (G_UNLIKELY (rtpdemux == NULL)) {
gst_event_unref (event);
return FALSE;
}
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_CUSTOM_DOWNSTREAM:

View file

@ -1325,8 +1325,10 @@ gst_rtp_session_event_recv_rtp_sink (GstPad * pad, GstEvent * event)
gboolean ret = FALSE;
rtpsession = GST_RTP_SESSION (gst_pad_get_parent (pad));
if (G_UNLIKELY (rtpsession == NULL))
if (G_UNLIKELY (rtpsession == NULL)) {
gst_event_unref (event);
return FALSE;
}
GST_DEBUG_OBJECT (rtpsession, "received event %s",
GST_EVENT_TYPE_NAME (event));
@ -1434,6 +1436,10 @@ gst_rtp_session_event_recv_rtp_src (GstPad * pad, GstEvent * event)
guint pt;
rtpsession = GST_RTP_SESSION (gst_pad_get_parent (pad));
if (G_UNLIKELY (rtpsession == NULL)) {
gst_event_unref (event);
return FALSE;
}
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_CUSTOM_UPSTREAM:
@ -1647,8 +1653,10 @@ gst_rtp_session_event_send_rtcp_src (GstPad * pad, GstEvent * event)
GST_DEBUG_OBJECT (rtpsession, "received EVENT");
rtpsession = GST_RTP_SESSION (gst_pad_get_parent (pad));
if (G_UNLIKELY (rtpsession == NULL))
if (G_UNLIKELY (rtpsession == NULL)) {
gst_event_unref (event);
return FALSE;
}
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_SEEK:

View file

@ -420,8 +420,10 @@ gst_rtp_ssrc_demux_sink_event (GstPad * pad, GstEvent * event)
gboolean res = FALSE;
demux = GST_RTP_SSRC_DEMUX (gst_pad_get_parent (pad));
if (G_UNLIKELY (demux == NULL))
if (G_UNLIKELY (demux == NULL)) {
gst_event_unref (event);
return FALSE;
}
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_FLUSH_STOP: