diff options
author | Benjamin Otte <otte@gnome.org> | 2003-04-25 17:35:26 +0000 |
---|---|---|
committer | Benjamin Otte <otte@gnome.org> | 2003-04-25 17:35:26 +0000 |
commit | 8cebfd75282112052fee00f70e9163ae5596ee25 (patch) | |
tree | fd64b0a4c5bb65017807bd6c967472b03f8feff5 /gst/parse | |
parent | b04519c43dd64387e20db214185ec0eff80e53d5 (diff) |
I suck - it's the wrong variable and I don't get it for ages even while testing this code
Original commit message from CVS:
I suck - it's the wrong variable and I don't get it for ages even while testing this code
But while I was atit, I fixed it right this time (I hope)
Diffstat (limited to 'gst/parse')
-rw-r--r-- | gst/parse/grammar.y | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/gst/parse/grammar.y b/gst/parse/grammar.y index 69602917a..47c2cea71 100644 --- a/gst/parse/grammar.y +++ b/gst/parse/grammar.y @@ -270,18 +270,17 @@ gst_parse_element_set (gchar *value, GstElement *element, graph_t *graph) gchar *endptr = NULL; GEnumClass *klass = (GEnumClass *) g_type_class_peek (G_PARAM_SPEC_VALUE_TYPE (pspec)); if (klass == NULL) goto error; - if (!(en = g_enum_get_value_by_name (klass, pos))) - en = g_enum_get_value_by_nick (klass, pos); - if (en) { - g_value_set_enum (&v, en->value); - } else { - gint i = strtol (value, &endptr, 0); - if (endptr && *endptr == '\0') { - g_value_set_enum (&v, i); - } else { - goto error; - } - } + if (!(en = g_enum_get_value_by_name (klass, pos))) { + if (!(en = g_enum_get_value_by_nick (klass, pos))) { + gint i = strtol (pos, &endptr, 0); + if (endptr && *endptr == '\0') { + en = g_enum_get_value (klass, i); + } + } + } + if (!en) + goto error; + g_value_set_enum (&v, en->value); break; } case G_TYPE_INT: |