From 370358147209ca01fb2ae1470084a11e0fc921df Mon Sep 17 00:00:00 2001 From: jpark37 Date: Sun, 23 Feb 2020 19:43:10 -0800 Subject: [PATCH] libobs: Pump graphics loop one final time for cleanup --- libobs/obs-video.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libobs/obs-video.c b/libobs/obs-video.c index 207ff1453..2e610af0d 100644 --- a/libobs/obs-video.c +++ b/libobs/obs-video.c @@ -844,7 +844,11 @@ void *obs_graphics_thread(void *param) srand((unsigned int)time(NULL)); - while (!video_output_stopped(obs->video.video)) { + for (;;) { + /* defer loop break to clean up sources */ + const bool stop_requested = + video_output_stopped(obs->video.video); + uint64_t frame_start = os_gettime_ns(); uint64_t frame_time_ns; bool raw_active = obs->video.raw_active > 0; @@ -920,6 +924,9 @@ void *obs_graphics_thread(void *param) fps_total_ns = 0; fps_total_frames = 0; } + + if (stop_requested) + break; } UNUSED_PARAMETER(param);