From 40920204b516a100ba92876dda36d9d993043ab3 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sun, 31 May 2020 02:44:29 +0200 Subject: [PATCH] source/mirror: Fix rare out-of-order lock on source Occasionally, mostly due to other sources rebuilding their UI, an out-of-order lock freeze can be observed with Source Mirror. This is unwanted, so we need to move the freezing logic into a place where freezing shouldn't happen. Fixes #228 Actually fixes #61 --- source/sources/source-mirror.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/source/sources/source-mirror.cpp b/source/sources/source-mirror.cpp index 258c64dc..c5e6f105 100644 --- a/source/sources/source-mirror.cpp +++ b/source/sources/source-mirror.cpp @@ -126,13 +126,7 @@ void mirror_instance::save(obs_data_t* data) } } -void mirror_instance::video_tick(float_t time) -{ - if (_source) { - _source_size.first = obs_source_get_width(_source.get()); - _source_size.second = obs_source_get_height(_source.get()); - } -} +void mirror_instance::video_tick(float_t time) {} void mirror_instance::video_render(gs_effect_t* effect) { @@ -146,6 +140,9 @@ void mirror_instance::video_render(gs_effect_t* effect) obs_source_get_name(_source.get())}; #endif + _source_size.first = obs_source_get_width(_source.get()); + _source_size.second = obs_source_get_height(_source.get()); + obs_source_video_render(_source.get()); }