rtpmanager: Make sure that used caps are not freed already (take 2)
authorPeter Kjellerstedt <pkj@axis.com>
Tue, 1 Sep 2009 10:47:51 +0000 (12:47 +0200)
committerPeter Kjellerstedt <pkj@axis.com>
Tue, 1 Sep 2009 11:04:14 +0000 (13:04 +0200)
This reintroduces the fix for bug #593391. It also applies it in
gst_rtp_session_sync_rtcp() which has very similar code to
gst_rtp_session_send_rtcp().

gst/rtpmanager/gstrtpsession.c

index 928e38b3cbbc33ad9e398aa350cf3d5846e8958f..d59124cc7a149ca7105261049d8806dd3ec54f1b 100644 (file)
@@ -1032,9 +1032,10 @@ gst_rtp_session_send_rtcp (RTPSession * sess, RTPSource * src,
     if (!(caps = GST_PAD_CAPS (rtcp_src))) {
       caps = gst_caps_new_simple ("application/x-rtcp", NULL);
       gst_pad_set_caps (rtcp_src, caps);
+    } else
       gst_caps_unref (caps);
-    }
     gst_buffer_set_caps (buffer, caps);
+    gst_caps_unref (caps);
     GST_LOG_OBJECT (rtpsession, "sending RTCP");
 
     gst_object_ref (rtcp_src);
@@ -1092,9 +1093,10 @@ gst_rtp_session_sync_rtcp (RTPSession * sess,
     if (!(caps = GST_PAD_CAPS (sync_src))) {
       caps = gst_caps_new_simple ("application/x-rtcp", NULL);
       gst_pad_set_caps (sync_src, caps);
+    } else
       gst_caps_unref (caps);
-    }
     gst_buffer_set_caps (buffer, caps);
+    gst_caps_unref (caps);
     gst_object_ref (sync_src);
     GST_RTP_SESSION_UNLOCK (rtpsession);