[farsight2/master] rtp: Create caps only if needed, fixes leak

Olivier Crête olivier.crete at collabora.co.uk
Tue Jul 21 18:12:48 PDT 2009


---
 gst/fsrtpconference/fs-rtp-discover-codecs.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/gst/fsrtpconference/fs-rtp-discover-codecs.c b/gst/fsrtpconference/fs-rtp-discover-codecs.c
index 4f32ba2..c872931 100644
--- a/gst/fsrtpconference/fs-rtp-discover-codecs.c
+++ b/gst/fsrtpconference/fs-rtp-discover-codecs.c
@@ -1144,8 +1144,7 @@ create_codec_cap_list (GstElementFactory *factory,
       CodecCap *entry = NULL;
       GList *found_item = NULL;
       GstStructure *structure = gst_caps_get_structure (caps, i);
-      GstCaps *cur_caps =
-          gst_caps_new_full (gst_structure_copy (structure), NULL);
+      GstCaps *cur_caps = NULL;
 
       /* FIXME fix this in gstreamer! The rtpdepay element is bogus, it claims to
        * be a depayloader yet has application/x-rtp on both sides and does
@@ -1161,6 +1160,8 @@ create_codec_cap_list (GstElementFactory *factory,
         continue;
       }
 
+      cur_caps = gst_caps_new_full (gst_structure_copy (structure), NULL);
+
       /* let's check if this caps is already in the list, if so let's replace
        * that CodecCap list instead of creating a new one */
       /* we need to compare both media caps and rtp caps */
-- 
1.5.6.5




More information about the farsight-commits mailing list