From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id EB4B248398 for ; Wed, 19 Feb 2025 17:30:13 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 338BF68C27A; Wed, 19 Feb 2025 19:30:09 +0200 (EET) Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EA1E068BECE for ; Wed, 19 Feb 2025 19:30:01 +0200 (EET) Received: from haasn.dev (unknown [10.30.1.1]) by haasn.dev (Postfix) with ESMTP id 8A82240A50; Wed, 19 Feb 2025 18:30:01 +0100 (CET) From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Wed, 19 Feb 2025 18:29:57 +0100 Message-ID: <20250219172958.197132-2-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20250219172958.197132-1-ffmpeg@haasn.xyz> References: <20250219172958.197132-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/3] avfilter/vf_libplacebo: allow differing formats per input X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Niklas Haas Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: From: Niklas Haas 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 Sponsored-by: nxtedition --- libavfilter/vf_libplacebo.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c index ce2065cc35..6eeda7f252 100644 --- a/libavfilter/vf_libplacebo.c +++ b/libavfilter/vf_libplacebo.c @@ -1146,8 +1146,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 */ -- 2.47.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".