From 82cdc6e8c6a30d621d47093996a1f1844f202bd9 Mon Sep 17 00:00:00 2001 From: jpark37 Date: Wed, 27 Nov 2019 16:38:35 -0800 Subject: [PATCH] libobs: Pump Win32 messages on the graphics thread Necessary for upcoming Windows Graphics Capture support. --- libobs/obs-video.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libobs/obs-video.c b/libobs/obs-video.c index 4b82aa366..207ff1453 100644 --- a/libobs/obs-video.c +++ b/libobs/obs-video.c @@ -24,6 +24,11 @@ #include "media-io/format-conversion.h" #include "media-io/video-frame.h" +#ifdef _WIN32 +#define WIN32_MEAN_AND_LEAN +#include +#endif + static uint64_t tick_sources(uint64_t cur_time, uint64_t last_time) { struct obs_core_data *data = &obs->data; @@ -874,6 +879,14 @@ void *obs_graphics_thread(void *param) last_time = tick_sources(obs->video.video_time, last_time); profile_end(tick_sources_name); +#ifdef _WIN32 + MSG msg; + while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { + TranslateMessage(&msg); + DispatchMessage(&msg); + } +#endif + profile_start(output_frame_name); output_frame(raw_active, gpu_active); profile_end(output_frame_name);