This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit 53ee8920351809d41c327233497d23491ed0895c Author: Niklas Haas <[email protected]> AuthorDate: Mon Mar 9 13:14:33 2026 +0100 Commit: Niklas Haas <[email protected]> CommitDate: Sat Mar 28 18:50:13 2026 +0100 swscale/graph: add way to roll back passes When an op list needs to be decomposed into a more complicated sequence of passes, the compile() code may need to roll back passes that have already been partially compiled, if a later pass fails to compile. This matters for subpass splitting (e.g. for filtering), as well as for plane splitting. Sponsored-by: Sovereign Tech Fund Signed-off-by: Niklas Haas <[email protected]> --- libswscale/graph.c | 7 +++++++ libswscale/graph.h | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/libswscale/graph.c b/libswscale/graph.c index c0e2a3792e..f65f338229 100644 --- a/libswscale/graph.c +++ b/libswscale/graph.c @@ -808,6 +808,13 @@ error: return ret; } +void ff_sws_graph_rollback(SwsGraph *graph, int since_idx) +{ + for (int i = since_idx; i < graph->num_passes; i++) + pass_free(graph->passes[i]); + graph->num_passes = since_idx; +} + void ff_sws_graph_free(SwsGraph **pgraph) { SwsGraph *graph = *pgraph; diff --git a/libswscale/graph.h b/libswscale/graph.h index 2ee4067b26..a139afe2ef 100644 --- a/libswscale/graph.h +++ b/libswscale/graph.h @@ -175,6 +175,11 @@ int ff_sws_graph_add_pass(SwsGraph *graph, enum AVPixelFormat fmt, void *priv, void (*free)(void *priv), SwsPass **out_pass); +/** + * Remove all passes added since the given index. + */ +void ff_sws_graph_rollback(SwsGraph *graph, int since_idx); + /** * Uninitialize any state associate with this filter graph and free it. */ _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
