rtpsession: set caps without the lock

Release the lock before setting the caps on the srcpad, which triggers an event,
which could eventually call back into us and cause a deadlock.
This commit is contained in:
Wim Taymans 2012-03-07 15:00:26 +01:00
parent 5cce960baa
commit 9942d3566e

View file

@ -1104,6 +1104,9 @@ gst_rtp_session_send_rtcp (RTPSession * sess, RTPSource * src,
if ((rtcp_src = rtpsession->send_rtcp_src)) {
GstCaps *caps;
gst_object_ref (rtcp_src);
GST_RTP_SESSION_UNLOCK (rtpsession);
/* set rtcp caps on output pad */
if (!(caps = gst_pad_get_current_caps (rtcp_src))) {
caps = gst_caps_new_empty_simple ("application/x-rtcp");
@ -1111,9 +1114,6 @@ gst_rtp_session_send_rtcp (RTPSession * sess, RTPSource * src,
}
gst_caps_unref (caps);
gst_object_ref (rtcp_src);
GST_RTP_SESSION_UNLOCK (rtpsession);
GST_LOG_OBJECT (rtpsession, "sending RTCP");
result = gst_pad_push (rtcp_src, buffer);
@ -1161,6 +1161,9 @@ gst_rtp_session_sync_rtcp (RTPSession * sess, RTPSource * src,
if ((sync_src = rtpsession->sync_src)) {
GstCaps *caps;
gst_object_ref (sync_src);
GST_RTP_SESSION_UNLOCK (rtpsession);
/* set rtcp caps on output pad */
if (!(caps = gst_pad_get_current_caps (sync_src))) {
caps = gst_caps_new_empty_simple ("application/x-rtcp");
@ -1168,9 +1171,6 @@ gst_rtp_session_sync_rtcp (RTPSession * sess, RTPSource * src,
}
gst_caps_unref (caps);
gst_object_ref (sync_src);
GST_RTP_SESSION_UNLOCK (rtpsession);
GST_LOG_OBJECT (rtpsession, "sending Sync RTCP");
result = gst_pad_push (sync_src, buffer);
gst_object_unref (sync_src);