From e621b69aa22d7ae0520b3183b0a2dfa2e8527679 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Tue, 24 Apr 2018 17:02:30 +0200 Subject: [PATCH] source-mirror: Ensure that we have a source on video_tick --- source/source-mirror.cpp | 11 ++++++++++- source/source-mirror.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/source/source-mirror.cpp b/source/source-mirror.cpp index 4e8562c..bb657ff 100644 --- a/source/source-mirror.cpp +++ b/source/source-mirror.cpp @@ -319,9 +319,18 @@ void Source::Mirror::deactivate() { m_active = false; } -void Source::Mirror::video_tick(float) { +void Source::Mirror::video_tick(float time) { + m_tick += time; + if (m_mirrorSource) { m_mirrorName = obs_source_get_name(m_mirrorSource->get_object()); + } else { + if (m_tick > 0.1f) { + obs_data_t* ref = obs_source_get_settings(m_source); + update(ref); + obs_data_release(ref); + m_tick -= 0.1f; + } } } diff --git a/source/source-mirror.h b/source/source-mirror.h index f24d476..4c35247 100644 --- a/source/source-mirror.h +++ b/source/source-mirror.h @@ -55,6 +55,7 @@ namespace Source { class Mirror { bool m_active; obs_source_t* m_source = nullptr; + float_t m_tick = 0; // Input Source std::string m_mirrorName;