From 20d4bab77a0f7149738b104cf2569d5b5b10ec98 Mon Sep 17 00:00:00 2001 From: Richard Stanway Date: Thu, 5 Jan 2023 03:11:16 +0100 Subject: [PATCH] win-capture: Always reset timeout when searching for target display If the display wasn't found, the timer was not reset, causing the code to execute on every single tick, stalling the graphics thread and using excessive CPU. --- plugins/win-capture/duplicator-monitor-capture.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/win-capture/duplicator-monitor-capture.c b/plugins/win-capture/duplicator-monitor-capture.c index 3fd96eeea..a1c9ccec8 100644 --- a/plugins/win-capture/duplicator-monitor-capture.c +++ b/plugins/win-capture/duplicator-monitor-capture.c @@ -526,9 +526,9 @@ static void duplicator_capture_tick(void *data, float seconds) capture->handle); } } - - capture->reset_timeout = 0.0f; } + + capture->reset_timeout = 0.0f; } } } else { @@ -563,10 +563,10 @@ static void duplicator_capture_tick(void *data, float seconds) capture->duplicator = gs_duplicator_create( dxgi_index); - - capture->reset_timeout = 0.0f; } } + + capture->reset_timeout = 0.0f; } }