source-mirror: Ensure that we have a source on video_tick
This commit is contained in:
parent
5e4a781912
commit
e621b69aa2
|
@ -319,9 +319,18 @@ void Source::Mirror::deactivate() {
|
||||||
m_active = false;
|
m_active = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Source::Mirror::video_tick(float) {
|
void Source::Mirror::video_tick(float time) {
|
||||||
|
m_tick += time;
|
||||||
|
|
||||||
if (m_mirrorSource) {
|
if (m_mirrorSource) {
|
||||||
m_mirrorName = obs_source_get_name(m_mirrorSource->get_object());
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,6 +55,7 @@ namespace Source {
|
||||||
class Mirror {
|
class Mirror {
|
||||||
bool m_active;
|
bool m_active;
|
||||||
obs_source_t* m_source = nullptr;
|
obs_source_t* m_source = nullptr;
|
||||||
|
float_t m_tick = 0;
|
||||||
|
|
||||||
// Input Source
|
// Input Source
|
||||||
std::string m_mirrorName;
|
std::string m_mirrorName;
|
||||||
|
|
Loading…
Reference in New Issue