diff options
author | Stefano Sabatini <stefasab@gmail.com> | 2013-04-12 00:06:52 +0200 |
---|---|---|
committer | Stefano Sabatini <stefasab@gmail.com> | 2013-04-12 00:18:39 +0200 |
commit | 9da369604ecf31d9dce2dee21ed214b8c43264c6 (patch) | |
tree | 6b37e18fc358f50077193b4f897ecfeba603c95d /libavfilter | |
parent | fdedfc029b355a1cd5f73f964685e2c76c8bd8ad (diff) | |
download | ffmpeg-9da369604ecf31d9dce2dee21ed214b8c43264c6.tar.gz |
lavfi/overlay: improve feedback in case of invalid expression
Based on vf_hue.c code.
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/vf_overlay.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/libavfilter/vf_overlay.c b/libavfilter/vf_overlay.c index b5c3f6f569..92ec258f15 100644 --- a/libavfilter/vf_overlay.c +++ b/libavfilter/vf_overlay.c @@ -167,7 +167,7 @@ static void eval_expr(AVFilterContext *ctx, enum EvalTarget eval_tgt) } } -static int set_expr(AVExpr **pexpr, const char *expr, void *log_ctx) +static int set_expr(AVExpr **pexpr, const char *expr, const char *option, void *log_ctx) { int ret; AVExpr *old = NULL; @@ -178,7 +178,8 @@ static int set_expr(AVExpr **pexpr, const char *expr, void *log_ctx) NULL, NULL, NULL, NULL, 0, log_ctx); if (ret < 0) { av_log(log_ctx, AV_LOG_ERROR, - "Error when evaluating the expression '%s'\n", expr); + "Error when evaluating the expression '%s' for %s\n", + expr, option); *pexpr = old; return ret; } @@ -194,11 +195,11 @@ static int process_command(AVFilterContext *ctx, const char *cmd, const char *ar int ret; if (!strcmp(cmd, "x")) - ret = set_expr(&over->x_pexpr, args, ctx); + ret = set_expr(&over->x_pexpr, args, cmd, ctx); else if (!strcmp(cmd, "y")) - ret = set_expr(&over->y_pexpr, args, ctx); + ret = set_expr(&over->y_pexpr, args, cmd, ctx); else if (!strcmp(cmd, "enable")) - ret = set_expr(&over->enable_pexpr, args, ctx); + ret = set_expr(&over->enable_pexpr, args, cmd, ctx); else ret = AVERROR(ENOSYS); @@ -318,9 +319,9 @@ static int config_input_overlay(AVFilterLink *inlink) over->var_values[VAR_T] = NAN; over->var_values[VAR_POS] = NAN; - if ((ret = set_expr(&over->x_pexpr, over->x_expr, ctx)) < 0 || - (ret = set_expr(&over->y_pexpr, over->y_expr, ctx)) < 0 || - (ret = set_expr(&over->enable_pexpr, over->enable_expr, ctx)) < 0) + if ((ret = set_expr(&over->x_pexpr, over->x_expr, "x", ctx)) < 0 || + (ret = set_expr(&over->y_pexpr, over->y_expr, "y", ctx)) < 0 || + (ret = set_expr(&over->enable_pexpr, over->enable_expr, "enable", ctx)) < 0) return ret; over->overlay_is_packed_rgb = |