aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/vf_delogo.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2019-09-02 16:12:01 +0200
committerPaul B Mahol <onemda@gmail.com>2019-09-02 16:17:46 +0200
commit6b0903075694092d543294dfbfdb4bc6be947eda (patch)
tree3e19dca21fe4a11c99f77b0e8bd95d7babf6a6e0 /libavfilter/vf_delogo.c
parente0fab59624c6fa556f820b147906460fac7fb5fc (diff)
downloadffmpeg-6b0903075694092d543294dfbfdb4bc6be947eda.tar.gz
avfilter/vf_delogo: unbreak fate
It is not clear what was real intention of previous commit to this filter. It was not working correctly, hopefully this is fixed now. It never checked that new x/y/w/h are actually valid, hopeffully this is fixed now. It uses named variables in expressions that are never set, still not fixed. It does not set named variables that uses actual frame widht/height, making actual expressions less usable for our users, still now fixed.
Diffstat (limited to 'libavfilter/vf_delogo.c')
-rw-r--r--libavfilter/vf_delogo.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libavfilter/vf_delogo.c b/libavfilter/vf_delogo.c
index 5323603ddb..814575a36c 100644
--- a/libavfilter/vf_delogo.c
+++ b/libavfilter/vf_delogo.c
@@ -318,6 +318,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
int direct = 0;
int plane;
AVRational sar;
+ int ret;
s->var_values[VAR_N] = inlink->frame_count_out;
s->var_values[VAR_T] = TS2T(in->pts, inlink->time_base);
@@ -326,6 +327,17 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
s->w = av_expr_eval(s->w_pexpr, s->var_values, s);
s->h = av_expr_eval(s->h_pexpr, s->var_values, s);
+ ret = config_input(inlink);
+ if (ret < 0) {
+ av_frame_free(&in);
+ return ret;
+ }
+
+ s->w += s->band*2;
+ s->h += s->band*2;
+ s->x -= s->band;
+ s->y -= s->band;
+
if (av_frame_is_writable(in)) {
direct = 1;
out = in;