upstream proposed fix for #59

This commit is contained in:
asquelt 2017-04-14 15:21:33 +02:00
parent fd17557a96
commit bdb53d07f5
2 changed files with 12 additions and 10 deletions

View File

@ -69,16 +69,7 @@ WSEvents::WSEvents(WSServer *srv)
transition_handler = nullptr;
scene_handler = nullptr;
WSEvents* instance = this;
QTimer::singleShot(1000, [instance]() {
obs_source_t* transition = obs_frontend_get_current_transition();
instance->connectTransitionSignals(transition);
obs_source_release(transition);
obs_source_t* scene = obs_frontend_get_current_scene();
instance->connectSceneSignals(scene);
obs_source_release(scene);
});
QTimer::singleShot(1000, this, SLOT(deferredInitOperations()));
_streaming_active = false;
_recording_active = false;
@ -92,6 +83,16 @@ WSEvents::~WSEvents()
obs_frontend_remove_event_callback(WSEvents::FrontendEventHandler, this);
}
void WSEvents::deferredInitOperations() {
obs_source_t* transition = obs_frontend_get_current_transition();
connectTransitionSignals(transition);
obs_source_release(transition);
obs_source_t* scene = obs_frontend_get_current_scene();
connectSceneSignals(scene);
obs_source_release(scene);
}
void WSEvents::FrontendEventHandler(enum obs_frontend_event event, void *private_data)
{
WSEvents *owner = static_cast<WSEvents *>(private_data);

View File

@ -37,6 +37,7 @@ class WSEvents : public QObject
private Q_SLOTS:
void StreamStatus();
void TransitionDurationChanged(int ms);
void deferredInitOperations();
private:
WSServer *_srv;