# HG changeset patch # User stefano # Date 1276712866 0 # Node ID 4059de4c9f9037b7120ad6e9b1ddc29b7f95181b # Parent 90651a77154965fb22d441eeb179603b5bbe69c3 Improve av_parse_eval() error reporting. diff -r 90651a771549 -r 4059de4c9f90 eval.c --- a/eval.c Wed Jun 16 10:35:56 2010 +0000 +++ b/eval.c Wed Jun 16 18:27:46 2010 +0000 @@ -182,7 +182,7 @@ static int parse_primary(AVExpr **e, Parser *p) { AVExpr *d = av_mallocz(sizeof(AVExpr)); - char *next= p->s; + char *next = p->s, *s0 = p->s; int ret, i; if (!d) @@ -211,7 +211,7 @@ p->s= strchr(p->s, '('); if (p->s==NULL) { - av_log(p, AV_LOG_ERROR, "undefined constant or missing (\n"); + av_log(p, AV_LOG_ERROR, "Undefined constant or missing '(' in '%s'\n", s0); p->s= next; av_free_expr(d); return AVERROR(EINVAL); @@ -222,7 +222,7 @@ if ((ret = parse_expr(&d, p)) < 0) return ret; if (p->s[0] != ')') { - av_log(p, AV_LOG_ERROR, "missing )\n"); + av_log(p, AV_LOG_ERROR, "Missing ')' in '%s'\n", s0); av_free_expr(d); return AVERROR(EINVAL); } @@ -239,7 +239,7 @@ parse_expr(&d->param[1], p); } if (p->s[0] != ')') { - av_log(p, AV_LOG_ERROR, "missing )\n"); + av_log(p, AV_LOG_ERROR, "Missing ')' or too many args in '%s'\n", s0); av_free_expr(d); return AVERROR(EINVAL); } @@ -290,7 +290,7 @@ } } - av_log(p, AV_LOG_ERROR, "unknown function\n"); + av_log(p, AV_LOG_ERROR, "Unknown function in '%s'\n", s0); av_free_expr(d); return AVERROR(EINVAL); }