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

Git pushed a commit to branch master
in repository ffmpeg.

commit 9571f5cf15ff83a0f1fd95ad11e1878b4d8dd4bc
Author:     Niklas Haas <[email protected]>
AuthorDate: Sat Mar 7 01:27:46 2026 +0100
Commit:     Niklas Haas <[email protected]>
CommitDate: Mon Mar 9 12:01:51 2026 +0100

    swscale/graph: simplify ff_sws_graph_add_pass() usages
    
    Now that this function returns a status code and takes care of cleanup on
    failure, many call-sites can just return the function directly.
    
    Signed-off-by: Niklas Haas <[email protected]>
---
 libswscale/graph.c        | 29 ++++++++++-------------------
 libswscale/ops_dispatch.c | 12 +++---------
 2 files changed, 13 insertions(+), 28 deletions(-)

diff --git a/libswscale/graph.c b/libswscale/graph.c
index 532fa32dbf..c8caf9488e 100644
--- a/libswscale/graph.c
+++ b/libswscale/graph.c
@@ -662,7 +662,6 @@ static int adapt_colors(SwsGraph *graph, SwsFormat src, 
SwsFormat dst,
     enum AVPixelFormat fmt_in, fmt_out;
     SwsColorMap map = {0};
     SwsLut3D *lut;
-    SwsPass *pass;
     int ret;
 
     /**
@@ -710,14 +709,9 @@ static int adapt_colors(SwsGraph *graph, SwsFormat src, 
SwsFormat dst,
         return ret;
     }
 
-    ret = ff_sws_graph_add_pass(graph, fmt_out, src.width, src.height,
-                                input, 1, run_lut3d, setup_lut3d, lut,
-                                free_lut3d, &pass);
-    if (ret < 0)
-        return ret;
-
-    *output = pass;
-    return 0;
+    return ff_sws_graph_add_pass(graph, fmt_out, src.width, src.height,
+                                 input, 1, run_lut3d, setup_lut3d, lut,
+                                 free_lut3d, output);
 }
 
 /***************************************
@@ -743,18 +737,15 @@ static int init_passes(SwsGraph *graph)
             return ret;
     }
 
-    if (!pass) {
-        /* No passes were added, so no operations were necessary */
-        graph->noop = 1;
+    if (pass)
+        return 0;
 
-        /* Add threaded memcpy pass */
-        ret = ff_sws_graph_add_pass(graph, dst.format, dst.width, dst.height,
-                                    pass, 1, run_copy, NULL, NULL, NULL, 
&pass);
-        if (ret < 0)
-            return ret;
-    }
+    /* No passes were added, so no operations were necessary */
+    graph->noop = 1;
 
-    return 0;
+    /* Add threaded memcpy pass */
+    return ff_sws_graph_add_pass(graph, dst.format, dst.width, dst.height,
+                                 pass, 1, run_copy, NULL, NULL, NULL, &pass);
 }
 
 static void sws_graph_worker(void *priv, int jobnr, int threadnr, int nb_jobs,
diff --git a/libswscale/ops_dispatch.c b/libswscale/ops_dispatch.c
index e7ec2671ec..4ad1f2e70b 100644
--- a/libswscale/ops_dispatch.c
+++ b/libswscale/ops_dispatch.c
@@ -347,15 +347,9 @@ static int compile(SwsGraph *graph, const SwsOpList *ops,
         p->idx_out[i] = i < p->planes_out ? ops->order_dst.in[i] : -1;
     }
 
-    SwsPass *pass;
-    ret = ff_sws_graph_add_pass(graph, dst->format, dst->width, dst->height,
-                                input, p->comp.slice_align, op_pass_run,
-                                op_pass_setup, p, op_pass_free, &pass);
-    if (ret < 0)
-        return ret;
-
-    *output = pass;
-    return 0;
+    return ff_sws_graph_add_pass(graph, dst->format, dst->width, dst->height,
+                                 input, p->comp.slice_align, op_pass_run,
+                                 op_pass_setup, p, op_pass_free, output);
 
 fail:
     op_pass_free(p);

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

Reply via email to