Small cleanup, fix fixed caps detection even on XML load

Original commit message from CVS:
Small cleanup, fix fixed caps detection even on XML load
This commit is contained in:
Wim Taymans 2002-12-18 23:00:34 +00:00
parent 7c84581a90
commit 61763adf68
2 changed files with 5 additions and 3 deletions

View file

@ -841,6 +841,7 @@ gst_caps_load_thyself (xmlNodePtr parent)
xmlNodePtr subfield = field->xmlChildrenNode; xmlNodePtr subfield = field->xmlChildrenNode;
GstCaps *caps; GstCaps *caps;
gchar *content; gchar *content;
gboolean fixed = TRUE;
g_mutex_lock (_gst_caps_chunk_lock); g_mutex_lock (_gst_caps_chunk_lock);
caps = g_mem_chunk_alloc0 (_gst_caps_chunk); caps = g_mem_chunk_alloc0 (_gst_caps_chunk);
@ -848,7 +849,6 @@ gst_caps_load_thyself (xmlNodePtr parent)
caps->refcount = 1; caps->refcount = 1;
caps->next = NULL; caps->next = NULL;
caps->fixed = TRUE;
while (subfield) { while (subfield) {
if (!strcmp (subfield->name, "name")) { if (!strcmp (subfield->name, "name")) {
@ -861,10 +861,13 @@ gst_caps_load_thyself (xmlNodePtr parent)
} }
else if (!strcmp (subfield->name, "properties")) { else if (!strcmp (subfield->name, "properties")) {
caps->properties = gst_props_load_thyself (subfield); caps->properties = gst_props_load_thyself (subfield);
fixed &= caps->properties->fixed;
} }
subfield = subfield->next; subfield = subfield->next;
} }
caps->fixed = fixed;
result = gst_caps_append (result, caps); result = gst_caps_append (result, caps);
} }
field = field->next; field = field->next;

View file

@ -35,8 +35,7 @@ extern GType _gst_caps_type;
#define GST_TYPE_CAPS (_gst_caps_type) #define GST_TYPE_CAPS (_gst_caps_type)
#define GST_CAPS(caps) \ #define GST_CAPS(caps) ((GstCaps *)(caps))
((GstCaps *)(caps))
#define GST_CAPS_IS_FIXED(caps) ((caps)->fixed) #define GST_CAPS_IS_FIXED(caps) ((caps)->fixed)
#define GST_CAPS_IS_CHAINED(caps) ((caps)->next) #define GST_CAPS_IS_CHAINED(caps) ((caps)->next)