This avoids creating empty caps and destroying them in the case of an error. We
also avoid double checking in other code path where we call the internal api.
GstStructure *structure;
gchar *s;
- g_return_val_if_fail (string, FALSE);
if (strcmp ("ANY", string) == 0) {
caps->flags = GST_CAPS_FLAGS_ANY;
return TRUE;
{
GstCaps *caps;
+ g_return_val_if_fail (string, FALSE);
+
caps = gst_caps_new_empty ();
if (gst_caps_from_string_inplace (caps, string)) {
return caps;