mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
upstream proposed fix for #59
This commit is contained in:
parent
fd17557a96
commit
bdb53d07f5
21
WSEvents.cpp
21
WSEvents.cpp
@ -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);
|
||||
|
@ -37,6 +37,7 @@ class WSEvents : public QObject
|
||||
private Q_SLOTS:
|
||||
void StreamStatus();
|
||||
void TransitionDurationChanged(int ms);
|
||||
void deferredInitOperations();
|
||||
|
||||
private:
|
||||
WSServer *_srv;
|
||||
|
Loading…
x
Reference in New Issue
Block a user