From 958b391afa82912189666d5633e1746e71789c35 Mon Sep 17 00:00:00 2001 From: Acaki Date: Thu, 21 Aug 2025 03:08:07 +0800 Subject: [PATCH] fix: another attempt to fix occasional video freeze with metal renderer --- VoidLink/Metal/MetalVideoRenderer.m | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/VoidLink/Metal/MetalVideoRenderer.m b/VoidLink/Metal/MetalVideoRenderer.m index 30aecf6c..09308216 100644 --- a/VoidLink/Metal/MetalVideoRenderer.m +++ b/VoidLink/Metal/MetalVideoRenderer.m @@ -705,7 +705,6 @@ CFStringRef __currentColorSpace; [commandBuffer presentDrawable:drawable]; [commandBuffer commit]; - [commandBuffer waitUntilCompleted]; } } @@ -716,11 +715,7 @@ CFStringRef __currentColorSpace; dispatch_time_t timeout = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1f * NSEC_PER_SEC)); // 100ms long result = dispatch_semaphore_wait(_inFlightSemaphore, timeout); if (result != 0) { - // Timeout occurred - this is the main cause of video freezes - // Signal the semaphore to unblock potentially stuck frames - for (NSUInteger i = 0; i < MaxFramesInFlight; i++) { - dispatch_semaphore_signal(_inFlightSemaphore); - } + Log(LOG_W, @"MetalVideoRenderer semaphore timeout - requesting IDR frame"); LiRequestIdrFrame(); // Request recovery } }