diff mbox series

[FFmpeg-devel,03/11] avfilter/overlay_vaapi: remove double framesync init

Message ID 2bd535abb506d1af278e1146de38529c22ed625b.1665399281.git.ffmpegagent@gmail.com
State New
Headers show
Series Fixes and Enhancements for VAAPI Overlay | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Aman Karmani Oct. 10, 2022, 10:54 a.m. UTC
From: softworkz <softworkz@hotmail.com>

Signed-off-by: softworkz <softworkz@hotmail.com>
---
 libavfilter/vf_overlay_vaapi.c | 31 +++++--------------------------
 1 file changed, 5 insertions(+), 26 deletions(-)
diff mbox series

Patch

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);
 }