summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorStefan Kost <ensonic@users.sf.net>2010-10-18 13:29:53 +0300
committerStefan Kost <ensonic@users.sf.net>2010-12-03 09:42:44 +0200
commitd370a2437af1adbb1bf28846fda467fc40e6c97d (patch)
tree272a3a6cf6d328fa2905ed8b51dda92a708c7c5f /gst
parent2d17d86ba8d03bb17246ae727acdb4092cab1e1c (diff)
registry: also intern the static caps
Diffstat (limited to 'gst')
-rw-r--r--gst/gstelementfactory.c7
-rw-r--r--gst/gstregistrychunks.c2
2 files changed, 5 insertions, 4 deletions
diff --git a/gst/gstelementfactory.c b/gst/gstelementfactory.c
index 829469180b..02d8ede46b 100644
--- a/gst/gstelementfactory.c
+++ b/gst/gstelementfactory.c
@@ -163,8 +163,6 @@ gst_element_factory_cleanup (GstElementFactory * factory)
GstStaticPadTemplate *templ = item->data;
GstCaps *caps = (GstCaps *) & (templ->static_caps);
- g_free ((gchar *) templ->static_caps.string);
-
/* FIXME: this is not threadsafe */
if (caps->refcount == 1) {
GstStructure *structure;
@@ -264,15 +262,18 @@ gst_element_register (GstPlugin * plugin, const gchar * name, guint rank,
for (item = klass->padtemplates; item; item = item->next) {
GstPadTemplate *templ = item->data;
GstStaticPadTemplate *newt;
+ gchar *caps_string = gst_caps_to_string (templ->caps);
newt = g_slice_new (GstStaticPadTemplate);
newt->name_template = g_intern_string (templ->name_template);
newt->direction = templ->direction;
newt->presence = templ->presence;
newt->static_caps.caps.refcount = 0;
- newt->static_caps.string = gst_caps_to_string (templ->caps);
+ newt->static_caps.string = g_intern_string (caps_string);
factory->staticpadtemplates =
g_list_append (factory->staticpadtemplates, newt);
+
+ g_free (caps_string);
}
factory->numpadtemplates = klass->numpadtemplates;
diff --git a/gst/gstregistrychunks.c b/gst/gstregistrychunks.c
index 9b3003eb49..b34dcfa4c0 100644
--- a/gst/gstregistrychunks.c
+++ b/gst/gstregistrychunks.c
@@ -505,7 +505,7 @@ gst_registry_chunks_load_pad_template (GstElementFactory * factory, gchar ** in,
/* unpack pad template strings */
unpack_const_string (*in, template->name_template, end, fail);
- unpack_string (*in, template->static_caps.string, end, fail);
+ unpack_const_string (*in, template->static_caps.string, end, fail);
__gst_element_factory_add_static_pad_template (factory, template);
GST_DEBUG ("Added pad_template %s", template->name_template);