mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-04 22:48:49 +00:00
Revert "validate-utils: simplify _read_builtin ()"
This breaks the fast_forward scenario parsing.
This reverts commit 0cfff156b1
.
This commit is contained in:
parent
ab65b1e743
commit
dad9d252bc
1 changed files with 14 additions and 12 deletions
|
@ -344,7 +344,7 @@ _read_argument (MathParser * parser)
|
||||||
static gdouble
|
static gdouble
|
||||||
_read_builtin (MathParser * parser)
|
_read_builtin (MathParser * parser)
|
||||||
{
|
{
|
||||||
gdouble v0;
|
gdouble v0 = 0.0, v1 = 0.0;
|
||||||
gchar c, token[PARSER_MAX_TOKEN_SIZE];
|
gchar c, token[PARSER_MAX_TOKEN_SIZE];
|
||||||
gint pos = 0;
|
gint pos = 0;
|
||||||
|
|
||||||
|
@ -358,24 +358,26 @@ _read_builtin (MathParser * parser)
|
||||||
|
|
||||||
if (_peek (parser) == '(') {
|
if (_peek (parser) == '(') {
|
||||||
_next (parser);
|
_next (parser);
|
||||||
v0 = _read_argument (parser);
|
if (g_strcmp0 (token, "min") == 0) {
|
||||||
|
v0 = _read_argument (parser);
|
||||||
if (g_strcmp0 (token, "min") == 0)
|
v1 = _read_argument (parser);
|
||||||
v0 = MIN (v0, _read_argument (parser));
|
v0 = MIN (v0, v1);
|
||||||
else if (g_strcmp0 (token, "max") == 0)
|
} else if (g_strcmp0 (token, "max") == 0) {
|
||||||
v0 = MAX (v0, _read_argument (parser));
|
v0 = _read_argument (parser);
|
||||||
else {
|
v1 = _read_argument (parser);
|
||||||
|
v0 = MAX (v0, v1);
|
||||||
|
} else {
|
||||||
_error (parser, "Tried to call unknown built-in function!");
|
_error (parser, "Tried to call unknown built-in function!");
|
||||||
return 0.0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_next (parser) != ')')
|
if (_next (parser) != ')')
|
||||||
_error (parser, "Expected ')' in built-in call!");
|
_error (parser, "Expected ')' in built-in call!");
|
||||||
} else {
|
} else {
|
||||||
if (parser->variable_func == NULL
|
if (parser->variable_func != NULL
|
||||||
|| !parser->variable_func (token, &v0, parser->user_data)) {
|
&& parser->variable_func (token, &v1, parser->user_data)) {
|
||||||
|
v0 = v1;
|
||||||
|
} else {
|
||||||
_error (parser, "Could not look up value for variable %s!");
|
_error (parser, "Could not look up value for variable %s!");
|
||||||
return 0.0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue