From dd13131fe68b903f39c8e8a6e252b3e8465cbee5 Mon Sep 17 00:00:00 2001 From: loki Date: Fri, 17 Apr 2020 19:18:55 +0200 Subject: [PATCH] Fix video freezing when resizing display with 2 or more sessions --- sunshine/video.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sunshine/video.cpp b/sunshine/video.cpp index 6ed2085d..ca42de3a 100644 --- a/sunshine/video.cpp +++ b/sunshine/video.cpp @@ -904,7 +904,6 @@ encode_e encode_run_sync(std::vector> &synce continue; } - sws_t sws; if(pos->img_tmp) { if(pos->hwdevice->convert(*pos->img_tmp)) { BOOST_LOG(error) << "Could not convert image"sv; @@ -989,6 +988,11 @@ void capture_async( int key_frame_nr = 1; while(!shutdown_event->peek() && images->running()) { + // Wait for the main capture event when the display is being reinitialized + if(ref->reinit_event.peek()) { + std::this_thread::sleep_for(100ms); + continue; + } // Wait for the display to be ready std::shared_ptr display; {