playbin2: avoid copying caps
authorWim Taymans <wim.taymans@collabora.co.uk>
Wed, 4 Nov 2009 17:57:07 +0000 (18:57 +0100)
committerWim Taymans <wim.taymans@collabora.co.uk>
Wed, 4 Nov 2009 17:57:07 +0000 (18:57 +0100)
Use get_caps_refed() when we can.

gst/playback/gstplaybin2.c
gst/playback/gsturidecodebin.c

index 705cf3d..82d5120 100644 (file)
@@ -2044,7 +2044,7 @@ pad_added_cb (GstElement * decodebin, GstPad * pad, GstSourceGroup * group)
 
   playbin = group->playbin;
 
-  caps = gst_pad_get_caps (pad);
+  caps = gst_pad_get_caps_refed (pad);
   s = gst_caps_get_structure (caps, 0);
   name = gst_structure_get_name (s);
 
index 3fa960d..2da61aa 100644 (file)
@@ -967,7 +967,7 @@ has_all_raw_caps (GstPad * pad, gboolean * all_raw)
   guint i, num_raw = 0;
   gboolean res = FALSE;
 
-  caps = gst_pad_get_caps (pad);
+  caps = gst_pad_get_caps_refed (pad);
   if (caps == NULL)
     return FALSE;