clean up and silence warnings

This commit is contained in:
WarmUpTill 2020-11-14 17:17:39 +01:00
parent 2ae97cd90e
commit e5c1e81d81
2 changed files with 6 additions and 9 deletions

View File

@ -438,18 +438,12 @@ void switchScene(OBSWeakSource &scene, OBSWeakSource &transition,
obs_source_t *currentSource = obs_frontend_get_current_scene();
if (source && source != currentSource) {
// this call might block when OBS_FRONTEND_EVENT_SCENE_CHANGED is active and mutex is held
// thus unlock mutex to avoid deadlock
lock.unlock();
transitionData td;
setNextTransition(scene, currentSource, transition,
transitionOverrideOverride, td);
obs_frontend_set_current_scene(source);
if (transitionOverrideOverride)
restoreTransitionOverride(source, td);
lock.lock();
if (switcher->verbose)
blog(LOG_INFO, "switched scene");
@ -539,6 +533,9 @@ void resetLiveTime(SwitcherData *s)
s->liveTime = QDateTime();
}
// Note to future self:
// be careful using switcher->m here as there is potential for deadlocks when using
// frontend functions such as obs_frontend_set_current_scene()
static void OBSEvent(enum obs_frontend_event event, void *switcher)
{
switch (event) {

View File

@ -143,9 +143,9 @@ struct SwitcherData {
std::vector<int> tabOrder;
bool hotkeysRegistered = false;
obs_hotkey_id startHotkey;
obs_hotkey_id stopHotkey;
obs_hotkey_id toggleHotkey;
obs_hotkey_id startHotkey = 0;
obs_hotkey_id stopHotkey = 0;
obs_hotkey_id toggleHotkey = 0;
void Thread();
void Start();