1
0
mirror of https://git.ffmpeg.org/ffmpeg.git synced 2026-10-24 02:09:03 +03:00

swscale/vulkan/ops: simplify device reinit check in ff_sws_vk_init()

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Niklas Haas <git@haasn.dev>
This commit is contained in:
Niklas Haas
2026-10-20 02:15:34 +02:00
committed by Niklas Haas
parent c35a4245ca
commit bbf8a9066f

View File

@@ -49,11 +49,11 @@ int ff_sws_vk_init(SwsContext *sws, AVBufferRef *dev_ref)
}
FFVulkanOpsCtx *s = c->hw_priv;
if (s->vkctx.device_ref && s->vkctx.device_ref->data != dev_ref->data) {
if (s->vkctx.device_ref) {
if (s->vkctx.device_ref->data == dev_ref->data)
return 0;
/* Reinitialize with new context */
ff_vk_uninit(&s->vkctx);
} else if (s->vkctx.device_ref && s->vkctx.device_ref->data == dev_ref->data) {
return 0;
}
err = ff_vk_init(&s->vkctx, sws, dev_ref, NULL);