From 12b4ab5d4d9e4fe8f25d9729048e73488d9e49d2 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Fri, 18 Nov 2022 16:11:25 +0100 Subject: [PATCH] avfilter/vf_libplacebo: fix output format selection After commit c0b93, it's possible that `ff_vk_filter_config_input` never gets called, leading to `s->vkctx.input_format` being left unset. This broke the format auto-selection logic in `libplacebo_config_output`, resulting in a default to yuv420p, instead of defaulting to the input format as intended. Fixes: c0b93c4f8be48e2abad1eb5358643a01b9e27613 --- libavfilter/vf_libplacebo.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c index 65865b7811..92f859fd94 100644 --- a/libavfilter/vf_libplacebo.c +++ b/libavfilter/vf_libplacebo.c @@ -551,9 +551,15 @@ fail: static int libplacebo_config_input(AVFilterLink *inlink) { + AVFilterContext *avctx = inlink->dst; + LibplaceboContext *s = avctx->priv; + if (inlink->format == AV_PIX_FMT_VULKAN) return ff_vk_filter_config_input(inlink); + /* Forward this to the vkctx for format selection */ + s->vkctx.input_format = inlink->format; + return 0; }