mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 04:31:06 +00:00
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:
parent
43a4763491
commit
1ca450ba5c
1 changed files with 2 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue