Commit e63899bcb6 for ffmpeg
commit e63899bcb6c96456c4eb2bf3ef03cc77f83f12f1
Author: Niklas Haas <git@haasn.dev>
Date: Tue Oct 20 20:45:10 2026 +0200
swscale/ops: always call ff_sws_op_list_update_comps() before printing
This tightens a pre-existing quirk, which is that ff_sws_op_list_print()
already trusts the metadata being accurate going into the call, though we
allowed the absence of metadata as an explicitly tolerated special case.
With this wording change, we now require that the metadata is always
up-to-date, which resolves a few annoying discrepancies that would otherwise
show up as a result of the following refactors.
Signed-off-by: Niklas Haas <git@haasn.dev>
diff --git a/libswscale/graph.c b/libswscale/graph.c
index 73319a135d..b8c2f65ae0 100644
--- a/libswscale/graph.c
+++ b/libswscale/graph.c
@@ -721,6 +721,7 @@ static int add_ops_convert_pass(SwsGraph *graph, const SwsFormat *src,
av_get_pix_fmt_name(src->format), av_get_pix_fmt_name(dst->format));
av_log(ctx, AV_LOG_DEBUG, "Unoptimized operation list:\n");
+ ff_sws_op_list_update_comps(ops);
ff_sws_op_list_print(ctx, AV_LOG_DEBUG, AV_LOG_TRACE, ops);
const int flags = SWS_OP_FLAG_OPTIMIZE | SWS_OP_FLAG_SPLIT_MEMCPY;
diff --git a/libswscale/ops.h b/libswscale/ops.h
index 1bebae6455..a6dc28621a 100644
--- a/libswscale/ops.h
+++ b/libswscale/ops.h
@@ -360,6 +360,9 @@ void ff_sws_op_list_remove_at(SwsOpList *ops, int index, int count);
/**
* Print out the contents of an operation list.
+ *
+ * Note: This requires having called `ff_sws_op_list_update_comps()` to
+ * refresh the output pads, or the output may be stale/missing.
*/
void ff_sws_op_list_print(void *log_ctx, int log_level, int log_level_extra,
const SwsOpList *ops);