source-mirror: Ensure that we have a source on video_tick

This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2018-04-24 17:02:30 +02:00
parent 5e4a781912
commit e621b69aa2
2 changed files with 11 additions and 1 deletions

View file

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

View file

@ -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;