diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-03-30 22:50:15 +0300 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-04-30 00:13:58 +0300 |
commit | f8fa392a2edb517c4b17ae0ea1dab806d38533dc (patch) | |
tree | 9bad169d429184c1fe4dd39c0f7b497f2c2503fb /libavfilter | |
parent | 828759ed9afab3d4a046c87cb060305062e81de7 (diff) |
avfilter/vf_vignette: force per frame evaluation if per frame variables are used
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/vf_vignette.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libavfilter/vf_vignette.c b/libavfilter/vf_vignette.c index 69ac6d7d32..286104963e 100644 --- a/libavfilter/vf_vignette.c +++ b/libavfilter/vf_vignette.c @@ -169,15 +169,20 @@ static void update_context(VignetteContext *s, AVFilterLink *inlink, AVFrame *fr s->var_values[VAR_T] = TS2T(frame->pts, inlink->time_base); s->var_values[VAR_PTS] = TS2D(frame->pts); } else { - s->var_values[VAR_N] = 0; + s->var_values[VAR_N] = NAN; s->var_values[VAR_T] = NAN; s->var_values[VAR_PTS] = NAN; } - s->angle = av_clipf(av_expr_eval(s->angle_pexpr, s->var_values, NULL), 0, M_PI_2); + s->angle = av_expr_eval(s->angle_pexpr, s->var_values, NULL); s->x0 = av_expr_eval(s->x0_pexpr, s->var_values, NULL); s->y0 = av_expr_eval(s->y0_pexpr, s->var_values, NULL); + if (isnan(s->x0) || isnan(s->y0) || isnan(s->angle)) + s->eval_mode = EVAL_MODE_FRAME; + + s->angle = av_clipf(s->angle, 0, M_PI_2); + if (s->backward) { for (y = 0; y < inlink->h; y++) { for (x = 0; x < inlink->w; x++) |