This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 17154619e55cc816a569d70c5a41c67590dde0f1
Author:     Niklas Haas <[email protected]>
AuthorDate: Thu Jun 18 13:11:13 2026 +0200
Commit:     Niklas Haas <[email protected]>
CommitDate: Tue Jun 23 11:48:13 2026 +0000

    swscale/ops_dispatch: group compilation args into struct
    
    This will make it easier to keep passing around these parameters in helper
    functions in the upcoming refactor.
    
    Take the opportunity to also rename the plain `compile` function to
    `compile_single`.
    
    Sponsored-by: Sovereign Tech Fund
    Signed-off-by: Niklas Haas <[email protected]>
---
 libswscale/ops_dispatch.c | 27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)

diff --git a/libswscale/ops_dispatch.c b/libswscale/ops_dispatch.c
index 4af53676f0..f17f40ebab 100644
--- a/libswscale/ops_dispatch.c
+++ b/libswscale/ops_dispatch.c
@@ -511,19 +511,26 @@ static void align_pass(SwsPass *pass, int block_size, 
const int *over_rw,
     buf->width_pad = FFMAX(buf->width_pad, pad_max);
 }
 
-static int compile(SwsGraph *graph, const SwsOpBackend *backend,
-                   const SwsOpList *ops, int flags, SwsPass *input,
-                   SwsPass **output)
+/* Unchanging part of parameter list */
+typedef struct CompileArgs {
+    const SwsOpBackend *backend;
+    SwsGraph *graph;
+    int flags;
+} CompileArgs;
+
+static int compile_single(const CompileArgs *args, const SwsOpList *ops,
+                          SwsPass *input, SwsPass **output)
 {
+    SwsGraph *graph = args->graph;
     SwsContext *ctx = graph->ctx;
     SwsOpPass *p = av_mallocz(sizeof(*p));
     if (!p)
         return AVERROR(ENOMEM);
 
-    int ret = ff_sws_ops_compile(ctx, backend, ops, &p->comp);
+    int ret = ff_sws_ops_compile(ctx, args->backend, ops, &p->comp);
     if (ret < 0)
         goto fail;
-    else if (flags & SWS_OP_FLAG_DRY_RUN)
+    else if (args->flags & SWS_OP_FLAG_DRY_RUN)
         goto fail; /* nothing to do, just return */
 
     const SwsCompiledOp *comp = &p->comp;
@@ -687,7 +694,13 @@ int ff_sws_compile_pass(SwsGraph *graph, const 
SwsOpBackend *backend,
         goto out;
     }
 
-    ret = compile(graph, backend, ops, flags, input, output);
+    const CompileArgs args = {
+        .backend = backend,
+        .graph   = graph,
+        .flags   = flags,
+    };
+
+    ret = compile_single(&args, ops, input, output);
     if (ret != AVERROR(ENOTSUP))
         goto out;
 
@@ -706,7 +719,7 @@ int ff_sws_compile_pass(SwsGraph *graph, const SwsOpBackend 
*backend,
             goto out;
         }
 
-        ret = compile(graph, backend, ops, flags, prev, &prev);
+        ret = compile_single(&args, ops, prev, &prev);
         if (ret < 0) {
             ff_sws_op_list_free(&rest);
             goto out;

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to