Caps with empty props (which is not NULL - gst_props_new_empty()) can result in an invalid string, so we need to chec...

Original commit message from CVS:
Caps with empty props (which is not NULL - gst_props_new_empty()) can result in an invalid string, so we need to check for empty props (as opposed to NULL props) too.
This commit is contained in:
Ronald S. Bultje 2003-11-09 21:26:13 +00:00
parent a0c36796ed
commit b96f885fa1

View file

@ -86,10 +86,13 @@ gst_caps_to_string (GstCaps *caps)
g_value_set_boxed (&value, caps->properties);
props = g_strdup_value_contents (&value);
g_value_unset (&value);
g_string_append (result, ", ");
g_string_append (result, props);
g_free (props);
/* this happens with empty (but existing) caps->properties */
if (props[0] != '\0') {
g_value_unset (&value);
g_string_append (result, ", ");
g_string_append (result, props);
g_free (props);
}
}
caps = caps->next;