gst/gstcaps.c: unset GValue after use

Original commit message from CVS:
* gst/gstcaps.c: (gst_caps_structure_simplify):
unset GValue after use
* gst/gstcaps.c: (gst_caps_append),
* gst/gstpad.c: (gst_pad_link_fixate), (gst_pad_template_new):
use gst_caps_simplify (reduces registry size by 30%)
* gst/gstpad.c: (gst_pad_template_new):
don't allow NULL caps
This commit is contained in:
Benjamin Otte 2004-04-22 03:34:43 +00:00
parent 03a9d6a747
commit a79d06fe59
3 changed files with 19 additions and 2 deletions

View file

@ -1,3 +1,13 @@
2004-04-22 Benjamin Otte <otte@gnome.org>
* gst/gstcaps.c: (gst_caps_structure_simplify):
unset GValue after use
* gst/gstcaps.c: (gst_caps_append),
* gst/gstpad.c: (gst_pad_link_fixate), (gst_pad_template_new):
use gst_caps_simplify (reduces registry size by 30%)
* gst/gstpad.c: (gst_pad_template_new):
don't allow NULL caps
2004-04-22 Benjamin Otte <otte@gnome.org>
* docs/gst/gstreamer-sections.txt:

View file

@ -298,6 +298,7 @@ gst_caps_append (GstCaps * caps1, GstCaps * caps2)
structure = gst_caps_get_structure (caps2, i);
gst_caps_append_structure (caps1, structure);
}
gst_caps_do_simplify (caps1);
}
g_ptr_array_free (caps2->structs, TRUE);
#ifdef USE_POISONING
@ -1186,6 +1187,7 @@ gst_caps_structure_simplify (const GstStructure * simplify,
g_assert (field.name != 0);
gst_structure_id_set_value (compare, field.name, &field.value);
gst_structure_free (ret);
g_value_unset (&field.value);
return NULL;
}
@ -1193,7 +1195,7 @@ gst_caps_structure_simplify (const GstStructure * simplify,
}
/**
* gst_caps_simplify:
* gst_caps_do_simplify:
* @caps: a #GstCaps to simplify
*
* Modifies the given @caps inplace into a representation that represents the

View file

@ -1151,6 +1151,7 @@ gst_pad_link_fixate (GstPadLink * link)
GST_DEBUG ("trying to fixate caps %" GST_PTR_FORMAT, caps);
gst_caps_do_simplify (caps);
while (!gst_caps_is_fixed (caps)) {
int i;
@ -1196,9 +1197,11 @@ gst_pad_link_fixate (GstPadLink * link)
break;
}
if (newcaps) {
G_GNUC_UNUSED gboolean bad;
gst_caps_do_simplify (newcaps);
#ifndef G_DISABLE_CHECKS
/* some mad checking for correctly working fixation functions */
gboolean bad;
if (i == 4) {
/* we trust the default fixation function unconditionally */
@ -3578,6 +3581,7 @@ gst_pad_template_new (const gchar * name_template,
GstPadTemplate *new;
g_return_val_if_fail (name_template != NULL, NULL);
g_return_val_if_fail (caps != NULL, NULL);
if (!name_is_valid (name_template, presence))
return NULL;
@ -3598,6 +3602,7 @@ gst_pad_template_new (const gchar * name_template,
GST_PAD_TEMPLATE_NAME_TEMPLATE (new) = g_strdup (name_template);
GST_PAD_TEMPLATE_DIRECTION (new) = direction;
GST_PAD_TEMPLATE_PRESENCE (new) = presence;
gst_caps_do_simplify (caps);
GST_PAD_TEMPLATE_CAPS (new) = caps;
return new;