From c74c4ef0415af5cb3a78cd6d6d09c511387d60a1 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 16 Dec 2023 16:21:54 -0600 Subject: [PATCH] Fix native Vulkan video decoding (non-imported frames) --- app/streaming/video/ffmpeg-renderers/plvk.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/streaming/video/ffmpeg-renderers/plvk.cpp b/app/streaming/video/ffmpeg-renderers/plvk.cpp index 7dfa84aa..12d0fa70 100644 --- a/app/streaming/video/ffmpeg-renderers/plvk.cpp +++ b/app/streaming/video/ffmpeg-renderers/plvk.cpp @@ -333,9 +333,10 @@ bool PlVkRenderer::prepareDecoderContext(AVCodecContext *context, AVDictionary * SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "Using Vulkan video decoding"); - if (m_Backend) { - context->hw_device_ctx = av_buffer_ref(m_HwDeviceCtx); - } + // This should only be called when we're acting as the decoder backend + SDL_assert(m_Backend == nullptr); + + context->hw_device_ctx = av_buffer_ref(m_HwDeviceCtx); return true; }