[FFmpeg-cvslog] avfilter/vf_guided: make use of link variables

Paul B Mahol git at videolan.org
Tue May 3 00:46:30 EEST 2022


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Mon May  2 23:30:33 2022 +0200| [17a4237a05122bc4ca99dfd3364d41ec3e2c01f9] | committer: Paul B Mahol

avfilter/vf_guided: make use of link variables

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=17a4237a05122bc4ca99dfd3364d41ec3e2c01f9
---

 libavfilter/vf_guided.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/libavfilter/vf_guided.c b/libavfilter/vf_guided.c
index c4a3902042..6f5b184bdb 100644
--- a/libavfilter/vf_guided.c
+++ b/libavfilter/vf_guided.c
@@ -398,6 +398,8 @@ static int config_output(AVFilterLink *outlink)
 static int activate(AVFilterContext *ctx)
 {
     GuidedContext *s = ctx->priv;
+    AVFilterLink *outlink = ctx->outputs[0];
+    AVFilterLink *inlink = ctx->inputs[0];
     AVFrame *frame = NULL;
     AVFrame *out = NULL;
     int ret, status;
@@ -405,26 +407,26 @@ static int activate(AVFilterContext *ctx)
     if (s->guidance)
         return ff_framesync_activate(&s->fs);
 
-    FF_FILTER_FORWARD_STATUS_BACK(ctx->outputs[0], ctx->inputs[0]);
+    FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink);
 
-    if ((ret = ff_inlink_consume_frame(ctx->inputs[0], &frame)) > 0) {
+    if ((ret = ff_inlink_consume_frame(inlink, &frame)) > 0) {
         if (ctx->is_disabled)
-            return ff_filter_frame(ctx->outputs[0], frame);
+            return ff_filter_frame(outlink, frame);
 
         ret = filter_frame(ctx, &out, frame, frame);
         av_frame_free(&frame);
         if (ret < 0)
             return ret;
-        ret = ff_filter_frame(ctx->outputs[0], out);
+        ret = ff_filter_frame(outlink, out);
     }
     if (ret < 0)
         return ret;
-    if (ff_inlink_acknowledge_status(ctx->inputs[0], &status, &pts)) {
-        ff_outlink_set_status(ctx->outputs[0], status, pts);
+    if (ff_inlink_acknowledge_status(inlink, &status, &pts)) {
+        ff_outlink_set_status(outlink, status, pts);
         return 0;
     }
-    if (ff_outlink_frame_wanted(ctx->outputs[0]))
-        ff_inlink_request_frame(ctx->inputs[0]);
+    if (ff_outlink_frame_wanted(outlink))
+        ff_inlink_request_frame(inlink);
     return 0;
 }
 



More information about the ffmpeg-cvslog mailing list