mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-04-21 17:47:28 -05:00
clean up and silence warnings
This commit is contained in:
parent
2ae97cd90e
commit
e5c1e81d81
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user