fix for caps api changes
authorWim Taymans <wim.taymans@collabora.co.uk>
Sun, 11 Mar 2012 18:06:59 +0000 (19:06 +0100)
committerWim Taymans <wim.taymans@collabora.co.uk>
Sun, 11 Mar 2012 18:06:59 +0000 (19:06 +0100)
gst/dtmf/gstdtmfsrc.c
gst/dtmf/gstrtpdtmfsrc.c

index e5a8eef..b3f24ff 100644 (file)
@@ -852,14 +852,16 @@ gst_dtmf_src_negotiate (GstBaseSrc * basesrc)
   caps = gst_pad_get_allowed_caps (GST_BASE_SRC_PAD (basesrc));
 
   if (!caps)
-    caps =
-        gst_caps_copy (gst_pad_get_pad_template_caps (GST_BASE_SRC_PAD
-            (basesrc)));
+    caps = gst_pad_get_pad_template_caps (GST_BASE_SRC_PAD (basesrc));
 
-  if (gst_caps_is_empty (caps))
+  if (gst_caps_is_empty (caps)) {
+    gst_caps_unref (caps);
     return FALSE;
+  }
+
+  caps = gst_caps_truncate (caps);
 
-  gst_caps_truncate (caps);
+  caps = gst_caps_make_writable (caps);
   s = gst_caps_get_structure (caps, 0);
 
   gst_structure_fixate_field_nearest_int (s, "rate", DEFAULT_SAMPLE_RATE);
index 6e6140a..a078a11 100644 (file)
@@ -904,7 +904,8 @@ gst_rtp_dtmf_src_negotiate (GstBaseSrc * basesrc)
     }
 
     /* now fixate, start by taking the first caps */
-    gst_caps_truncate (temp);
+    temp = gst_caps_truncate (temp);
+    temp = gst_caps_make_writable (temp);
     srccaps = temp;
 
     /* get first structure */