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
This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2020-05-31 02:44:29 +02:00
parent 2fb2b07990
commit 40920204b5

View file

@ -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());
}