diff --git a/validate/gst/validate/gst-validate-utils.c b/validate/gst/validate/gst-validate-utils.c index f2db381a92..1a7312a568 100644 --- a/validate/gst/validate/gst-validate-utils.c +++ b/validate/gst/validate/gst-validate-utils.c @@ -484,18 +484,21 @@ gst_validate_utils_flags_from_str (GType type, const gchar * str_flags) return flags; } -void +gboolean gst_validate_utils_enum_from_str (GType type, const gchar * str_enum, guint * enum_value) { guint i; GEnumClass *class = g_type_class_ref (type); + gboolean ret = FALSE; for (i = 0; i < class->n_values; i++) { if (g_strrstr (str_enum, class->values[i].value_nick)) { *enum_value = class->values[i].value; - break; + ret = TRUE; } } g_type_class_unref (class); + + return ret; } diff --git a/validate/gst/validate/gst-validate-utils.h b/validate/gst/validate/gst-validate-utils.h index 9d8e717222..62d6ba4cbc 100644 --- a/validate/gst/validate/gst-validate-utils.h +++ b/validate/gst/validate/gst-validate-utils.h @@ -36,7 +36,7 @@ gdouble gst_validate_utils_parse_expression (const gchar *expr, gpointer user_data, gchar **error); guint gst_validate_utils_flags_from_str (GType type, const gchar * str_flags); -void gst_validate_utils_enum_from_str (GType type, +gboolean gst_validate_utils_enum_from_str (GType type, const gchar * str_enum, guint * enum_value); #endif