rtspsrc: free caps in ptmap array
authorWim Taymans <wtaymans@redhat.com>
Mon, 24 Mar 2014 13:35:01 +0000 (14:35 +0100)
committerWim Taymans <wtaymans@redhat.com>
Mon, 24 Mar 2014 13:35:01 +0000 (14:35 +0100)
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=726696

gst/rtsp/gstrtspsrc.c

index 8455ffe..cce876a 100644 (file)
@@ -1397,6 +1397,13 @@ get_aggregate_control (GstRTSPSrc * src)
   return base;
 }
 
+static void
+clear_ptmap_item (PtMapItem * item)
+{
+  if (item->caps)
+    gst_caps_unref (item->caps);
+}
+
 static GstRTSPStream *
 gst_rtspsrc_create_stream (GstRTSPSrc * src, GstSDPMessage * sdp, gint idx)
 {
@@ -1424,6 +1431,7 @@ gst_rtspsrc_create_stream (GstRTSPSrc * src, GstSDPMessage * sdp, gint idx)
   stream->timebase = -1;
   stream->profile = GST_RTSP_PROFILE_AVP;
   stream->ptmap = g_array_new (FALSE, FALSE, sizeof (PtMapItem));
+  g_array_set_clear_func (stream->ptmap, (GDestroyNotify) clear_ptmap_item);
 
   /* collect bandwidth information for this steam. FIXME, configure in the RTP
    * session manager to scale RTCP. */