From: Haakon Sporsheim Date: Thu, 28 Apr 2011 20:59:28 +0000 (+0200) Subject: rtpsession: Ensure MT safe event handling and plug event leak. X-Git-Tag: 1.19.3~509^2~6098 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=86c13ceae6eeefb092d641b6fb54cfa591b653d1;p=platform%2Fupstream%2Fgstreamer.git rtpsession: Ensure MT safe event handling and plug event leak. https://bugzilla.gnome.org/show_bug.cgi?id=667826 --- diff --git a/gst/rtpmanager/gstrtpsession.c b/gst/rtpmanager/gstrtpsession.c index 78007f5..f09a3fb 100644 --- a/gst/rtpmanager/gstrtpsession.c +++ b/gst/rtpmanager/gstrtpsession.c @@ -1435,8 +1435,21 @@ gst_rtp_session_event_recv_rtp_src (GstPad * pad, GstObject * parent, break; } - if (forward) - ret = gst_pad_push_event (rtpsession->recv_rtp_sink, event); + if (forward) { + GstPad *recv_rtp_sink = NULL; + GST_RTP_SESSION_LOCK (rtpsession); + if (rtpsession->recv_rtp_sink) + recv_rtp_sink = gst_object_ref (rtpsession->recv_rtp_sink); + GST_RTP_SESSION_UNLOCK (rtpsession); + + if (recv_rtp_sink) { + ret = gst_pad_push_event (recv_rtp_sink, event); + gst_object_unref (recv_rtp_sink); + } else + gst_event_unref (event); + } else { + gst_event_unref (event); + } return ret; }