From 896456a8acb7c6edb59be68976affea5669d0d5e Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 11 Feb 2024 00:15:32 -0600 Subject: [PATCH] Wait for command buffer completion before returning from renderFrame() --- app/streaming/video/ffmpeg-renderers/vt.mm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/streaming/video/ffmpeg-renderers/vt.mm b/app/streaming/video/ffmpeg-renderers/vt.mm index f46ae3ea..7a2f32fe 100644 --- a/app/streaming/video/ffmpeg-renderers/vt.mm +++ b/app/streaming/video/ffmpeg-renderers/vt.mm @@ -523,6 +523,9 @@ public: [commandBuffer presentDrawable:m_NextDrawable]; [commandBuffer commit]; + // Wait for the command buffer to complete and free our CVMetalTextureCache references + [commandBuffer waitUntilCompleted]; + [m_NextDrawable release]; m_NextDrawable = nullptr; }}