diff options
author | Pascal Buhler <pabuhler@cisco.com> | 2012-01-04 10:29:45 +0100 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.com> | 2013-02-01 12:32:42 +0100 |
commit | f67cb58b5e67db957eaee25302e0e2465df2448d (patch) | |
tree | 7a0c78c4f24042a1de11eac9240ae51757a899b8 | |
parent | 2ba9d9472d74908200c839d3001d78a086093259 (diff) |
rtpssrcdemux: Safely push on pads that might be removed due to a RTCP BYE
https://bugzilla.gnome.org/show_bug.cgi?id=667815
-rw-r--r-- | gst/rtpmanager/gstrtpssrcdemux.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gst/rtpmanager/gstrtpssrcdemux.c b/gst/rtpmanager/gstrtpssrcdemux.c index 523f9c509..644034cdc 100644 --- a/gst/rtpmanager/gstrtpssrcdemux.c +++ b/gst/rtpmanager/gstrtpssrcdemux.c @@ -541,6 +541,17 @@ gst_rtp_ssrc_demux_chain (GstPad * pad, GstBuffer * buf) /* push to srcpad */ ret = gst_pad_push (srcpad, buf); + if (ret != GST_FLOW_OK) { + /* check if the ssrc still there, may have been removed */ + GST_PAD_LOCK (demux); + dpad = find_demux_pad_for_ssrc (demux, ssrc); + if (dpad == NULL || dpad->rtp_pad != srcpad) { + /* SSRC was removed during the push ... ignore the error */ + ret = GST_FLOW_OK; + } + GST_PAD_UNLOCK (demux); + } + gst_object_unref (srcpad); return ret; @@ -606,6 +617,17 @@ gst_rtp_ssrc_demux_rtcp_chain (GstPad * pad, GstBuffer * buf) /* push to srcpad */ ret = gst_pad_push (srcpad, buf); + if (ret != GST_FLOW_OK) { + /* check if the ssrc still there, may have been removed */ + GST_PAD_LOCK (demux); + dpad = find_demux_pad_for_ssrc (demux, ssrc); + if (dpad == NULL || dpad->rtcp_pad != srcpad) { + /* SSRC was removed during the push ... ignore the error */ + ret = GST_FLOW_OK; + } + GST_PAD_UNLOCK (demux); + } + gst_object_unref (srcpad); return ret; |