diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2015-11-10 18:13:46 +0100 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2015-11-10 18:13:46 +0100 |
commit | 43266457b4f96e5f8becedf71971e4bb149afca3 (patch) | |
tree | 74d653b18e9532ec393c9a65baaa6145963f4829 | |
parent | 240ac53a5cccaccb0a17d42ab443ec3425423373 (diff) | |
parent | 2ec112f71cd03ccab1b6f9a00d29199a57bcc7a5 (diff) | |
download | ffmpeg-streaming-43266457b4f96e5f8becedf71971e4bb149afca3.zip ffmpeg-streaming-43266457b4f96e5f8becedf71971e4bb149afca3.tar.gz |
Merge commit '2ec112f71cd03ccab1b6f9a00d29199a57bcc7a5'
* commit '2ec112f71cd03ccab1b6f9a00d29199a57bcc7a5':
vf_pad: fix x, y option expression evaluation
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
-rw-r--r-- | libavfilter/vf_pad.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libavfilter/vf_pad.c b/libavfilter/vf_pad.c index 63dc6a8..d94ced1 100644 --- a/libavfilter/vf_pad.c +++ b/libavfilter/vf_pad.c @@ -123,12 +123,17 @@ static int config_input(AVFilterLink *inlink) NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0) goto eval_fail; s->h = var_values[VAR_OUT_H] = var_values[VAR_OH] = res; + if (!s->h) + var_values[VAR_OUT_H] = var_values[VAR_OH] = s->h = inlink->h; + /* evaluate the width again, as it may depend on the evaluated output height */ if ((ret = av_expr_parse_and_eval(&res, (expr = s->w_expr), var_names, var_values, NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0) goto eval_fail; s->w = var_values[VAR_OUT_W] = var_values[VAR_OW] = res; + if (!s->w) + var_values[VAR_OUT_W] = var_values[VAR_OW] = s->w = inlink->w; /* evaluate x and y */ av_expr_parse_and_eval(&res, (expr = s->x_expr), @@ -153,11 +158,6 @@ static int config_input(AVFilterLink *inlink) return AVERROR(EINVAL); } - if (!s->w) - s->w = inlink->w; - if (!s->h) - s->h = inlink->h; - s->w = ff_draw_round_to_sub(&s->draw, 0, -1, s->w); s->h = ff_draw_round_to_sub(&s->draw, 1, -1, s->h); s->x = ff_draw_round_to_sub(&s->draw, 0, -1, s->x); |