diff options
author | Niklas Haas <git@haasn.dev> | 2025-02-19 18:21:53 +0100 |
---|---|---|
committer | Niklas Haas <git@haasn.dev> | 2025-02-27 18:56:49 +0100 |
commit | d48745ba1cab3dbaf029e24aeef3c866b51cf6f9 (patch) | |
tree | fe5414746553980248a391c89b2894442e89b461 | |
parent | 6602b88df688a0697f93517028cdbec3e7c4d7c9 (diff) | |
download | ffmpeg-d48745ba1cab3dbaf029e24aeef3c866b51cf6f9.tar.gz |
avfilter/vf_libplacebo: allow differing formats per input
Each input is entirely independent and can have varying pixel formats,
color spaces, etc. To accomplish this, we need to make a full copy of the
format list for each subsequent input, rather than sharing the same ref.
Signed-off-by: Niklas Haas <git@haasn.dev>
Sponsored-by: nxtedition
-rw-r--r-- | libavfilter/vf_libplacebo.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c index 6254951e0a..b53543299d 100644 --- a/libavfilter/vf_libplacebo.c +++ b/libavfilter/vf_libplacebo.c @@ -1159,8 +1159,16 @@ static int libplacebo_query_format(const AVFilterContext *ctx, goto fail; } - for (int i = 0; i < s->nb_inputs; i++) + for (int i = 0; i < s->nb_inputs; i++) { + if (i > 0) { + /* Duplicate the format list for each subsequent input */ + infmts = NULL; + for (int n = 0; n < cfg_in[0]->formats->nb_formats; n++) + RET(ff_add_format(&infmts, cfg_in[0]->formats->formats[n])); + } RET(ff_formats_ref(infmts, &cfg_in[i]->formats)); + } + RET(ff_formats_ref(outfmts, &cfg_out[0]->formats)); /* Set colorspace properties */ |