caps: move the check to the public api.

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.
This commit is contained in:
Stefan Kost 2010-03-03 23:37:01 +02:00
parent 43a4763491
commit 1ca450ba5c

View file

@ -2070,7 +2070,6 @@ gst_caps_from_string_inplace (GstCaps * caps, const gchar * string)
GstStructure *structure;
gchar *s;
g_return_val_if_fail (string, FALSE);
if (strcmp ("ANY", string) == 0) {
caps->flags = GST_CAPS_FLAGS_ANY;
return TRUE;
@ -2116,6 +2115,8 @@ gst_caps_from_string (const gchar * string)
{
GstCaps *caps;
g_return_val_if_fail (string, FALSE);
caps = gst_caps_new_empty ();
if (gst_caps_from_string_inplace (caps, string)) {
return caps;