From 1ca450ba5cbf25537ded5f44305aad32096ac292 Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Wed, 3 Mar 2010 23:37:01 +0200 Subject: [PATCH] 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. --- gst/gstcaps.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gst/gstcaps.c b/gst/gstcaps.c index 2804cd96c1..c2ca2bc079 100644 --- a/gst/gstcaps.c +++ b/gst/gstcaps.c @@ -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;