This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit 69b8194089c529c7b48c9831b7b6fe106d5a1c27 Author: Niklas Haas <[email protected]> AuthorDate: Wed Oct 28 15:19:34 2026 +0100 Commit: Niklas Haas <[email protected]> CommitDate: Sat Oct 31 13:37:58 2026 +0100 avfilter/vf_libplacebo: factor out choose_default_device() Co-Authored-By: Claude Opus 5.5 <[email protected]> Sponsored-by: nxtedition AB Signed-off-by: Niklas Haas <[email protected]> --- libavfilter/vf_libplacebo.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c index f330eb39df..aa2ec949ad 100644 --- a/libavfilter/vf_libplacebo.c +++ b/libavfilter/vf_libplacebo.c @@ -571,6 +571,17 @@ static int append_inputs(AVFilterContext *avctx, int nb_inputs, return 0; } +/* Returns the filter's own Vulkan device, if it has one */ +static const AVVulkanDeviceContext *choose_default_device(const AVFilterContext *avctx) +{ + if (avctx->hw_device_ctx) { + const AVHWDeviceContext *avhwctx = (void *) avctx->hw_device_ctx->data; + if (avhwctx->type == AV_HWDEVICE_TYPE_VULKAN) + return avhwctx->hwctx; + } + return NULL; +} + static int libplacebo_init(AVFilterContext *avctx) { int err = 0; @@ -618,13 +629,7 @@ static int libplacebo_init(AVFilterContext *avctx) * hw_device_ctx even if it would be compatible. This ensure consistent * behaviour when the flag is set. */ if (!s->inherit_device) { - const AVVulkanDeviceContext *vkhwctx = NULL; - if (avctx->hw_device_ctx) { - const AVHWDeviceContext *avhwctx = (void *) avctx->hw_device_ctx->data; - if (avhwctx->type == AV_HWDEVICE_TYPE_VULKAN) - vkhwctx = avhwctx->hwctx; - } - RET(init_vulkan(avctx, vkhwctx)); + RET(init_vulkan(avctx, choose_default_device(avctx))); RET(libplacebo_setup_gpu(avctx)); } -- To stop receiving notification emails like this one, please contact [email protected]. _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
