avfilter: add comments for duplicate line
authorSteven Liu <lq@chinaffmpeg.org>
Thu, 1 Feb 2018 02:55:19 +0000 (10:55 +0800)
committerSteven Liu <lq@chinaffmpeg.org>
Thu, 1 Feb 2018 02:55:19 +0000 (10:55 +0800)
comment about the looks like a duplicate line.
but that is used to reason x is expressed from y

Suggested-by: Paul B Mahol
Suggested-by: Michael Niedermayer
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
libavfilter/vf_crop.c
libavfilter/vf_drawtext.c
libavfilter/vf_overlay.c

index 7c31c1665d91c9d3296ff597cf5be70f97bac60a..0fdc4949e3bd47d752c8d682dce39c3dc0a312fd 100644 (file)
@@ -262,6 +262,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame)
         NAN : frame->pkt_pos;
     s->var_values[VAR_X] = av_expr_eval(s->x_pexpr, s->var_values, NULL);
     s->var_values[VAR_Y] = av_expr_eval(s->y_pexpr, s->var_values, NULL);
+    /* It is necessary if x is expressed from y  */
     s->var_values[VAR_X] = av_expr_eval(s->x_pexpr, s->var_values, NULL);
 
     normalize_double(&s->x, s->var_values[VAR_X]);
index f97a741b5085d3010dbd872e22db54c9d40beee5..e8905a40d3eadc00b493ad33049208541ba3a728 100644 (file)
@@ -1390,6 +1390,7 @@ static int draw_text(AVFilterContext *ctx, AVFrame *frame,
 
     s->x = s->var_values[VAR_X] = av_expr_eval(s->x_pexpr, s->var_values, &s->prng);
     s->y = s->var_values[VAR_Y] = av_expr_eval(s->y_pexpr, s->var_values, &s->prng);
+    /* It is necessary if x is expressed from y  */
     s->x = s->var_values[VAR_X] = av_expr_eval(s->x_pexpr, s->var_values, &s->prng);
 
     update_alpha(s);
index aa5835ae3abf480aeea8e5a255eb9a26d8618363..c6a6ac82f397aa30d1203d378c03f2f073680485 100644 (file)
@@ -149,6 +149,7 @@ static void eval_expr(AVFilterContext *ctx)
 
     s->var_values[VAR_X] = av_expr_eval(s->x_pexpr, s->var_values, NULL);
     s->var_values[VAR_Y] = av_expr_eval(s->y_pexpr, s->var_values, NULL);
+    /* It is necessary if x is expressed from y  */
     s->var_values[VAR_X] = av_expr_eval(s->x_pexpr, s->var_values, NULL);
     s->x = normalize_xy(s->var_values[VAR_X], s->hsub);
     s->y = normalize_xy(s->var_values[VAR_Y], s->vsub);