From 55cc8312ccbc4c48f013a64b88a639df698f1aac Mon Sep 17 00:00:00 2001 From: softworkz Date: Mon, 31 Oct 2022 06:19:59 +0000 Subject: avfilter/overlay_vaapi: remove double framesync init Signed-off-by: softworkz --- libavfilter/vf_overlay_vaapi.c | 31 +++++-------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) (limited to 'libavfilter') diff --git a/libavfilter/vf_overlay_vaapi.c b/libavfilter/vf_overlay_vaapi.c index cf17426b5d..66e736cce4 100644 --- a/libavfilter/vf_overlay_vaapi.c +++ b/libavfilter/vf_overlay_vaapi.c @@ -265,28 +265,6 @@ fail: return err; } -static int overlay_vaapi_init_framesync(AVFilterContext *avctx) -{ - OverlayVAAPIContext *ctx = avctx->priv; - int ret, i; - - ctx->fs.on_event = overlay_vaapi_blend; - ctx->fs.opaque = ctx; - ret = ff_framesync_init(&ctx->fs, avctx, avctx->nb_inputs); - if (ret < 0) - return ret; - - for (i = 0; i < avctx->nb_inputs; i++) { - FFFrameSyncIn *in = &ctx->fs.in[i]; - in->before = EXT_STOP; - in->after = EXT_INFINITY; - in->sync = i ? 1 : 2; - in->time_base = avctx->inputs[i]->time_base; - } - - return ff_framesync_configure(&ctx->fs); -} - static int overlay_vaapi_config_output(AVFilterLink *outlink) { AVFilterContext *avctx = outlink->src; @@ -294,10 +272,7 @@ static int overlay_vaapi_config_output(AVFilterLink *outlink) VAAPIVPPContext *vpp_ctx = avctx->priv; int err; - err = overlay_vaapi_init_framesync(avctx); - if (err < 0) - return err; - + outlink->time_base = avctx->inputs[0]->time_base; vpp_ctx->output_width = avctx->inputs[0]->w; vpp_ctx->output_height = avctx->inputs[0]->h; @@ -313,6 +288,10 @@ static int overlay_vaapi_config_output(AVFilterLink *outlink) if (err < 0) return err; + ctx->fs.on_event = overlay_vaapi_blend; + ctx->fs.opaque = ctx; + ctx->fs.time_base = outlink->time_base; + return ff_framesync_configure(&ctx->fs); } -- cgit v1.2.3