mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-03-28 12:55:28 -05:00
only try auto start streaming/recording once on scene chagne
This commit is contained in:
parent
95261ce9bb
commit
a5c8d776f3
|
|
@ -362,6 +362,9 @@ void handleSceneChange(SwitcherData *s)
|
|||
s->previousScene = s->PreviousScene2;
|
||||
s->PreviousScene2 = ws;
|
||||
}
|
||||
|
||||
//reset autostart
|
||||
s->autoStartedRecently = false;
|
||||
}
|
||||
|
||||
static void OBSEvent(enum obs_frontend_event event, void *switcher)
|
||||
|
|
|
|||
|
|
@ -212,6 +212,9 @@ void SwitcherData::autoStartStreamRecording()
|
|||
obs_source_t *currentSource = obs_frontend_get_current_scene();
|
||||
obs_weak_source_t *ws = obs_source_get_weak_source(currentSource);
|
||||
|
||||
if (autoStartedRecently)
|
||||
return;
|
||||
|
||||
if (ws && autoStartScene == ws) {
|
||||
if ((switcher->autoStartType == STREAMING ||
|
||||
switcher->autoStartType == RECORINDGSTREAMING) &&
|
||||
|
|
@ -224,6 +227,8 @@ void SwitcherData::autoStartStreamRecording()
|
|||
}
|
||||
obs_source_release(currentSource);
|
||||
obs_weak_source_release(ws);
|
||||
|
||||
autoStartedRecently = true;
|
||||
}
|
||||
|
||||
void SceneSwitcher::on_verboseLogging_stateChanged(int state)
|
||||
|
|
|
|||
|
|
@ -254,7 +254,11 @@ struct TimeSwitch {
|
|||
|
||||
typedef enum { NO_SWITCH = 0, SWITCH = 1, RANDOM_SWITCH = 2 } NoMatch;
|
||||
typedef enum { PERSIST = 0, START = 1, STOP = 2 } StartupBehavior;
|
||||
typedef enum { RECORDING = 0, STREAMING = 1, RECORINDGSTREAMING = 2 } AutoStartType;
|
||||
typedef enum {
|
||||
RECORDING = 0,
|
||||
STREAMING = 1,
|
||||
RECORINDGSTREAMING = 2
|
||||
} AutoStartType;
|
||||
|
||||
class SwitcherThread;
|
||||
|
||||
|
|
@ -312,6 +316,7 @@ struct SwitcherData {
|
|||
bool autoStartEnable = false;
|
||||
AutoStartType autoStartType = RECORDING;
|
||||
OBSWeakSource autoStartScene;
|
||||
bool autoStartedRecently = false;
|
||||
|
||||
std::vector<SceneTransition> sceneTransitions;
|
||||
std::vector<DefaultSceneTransition> defaultSceneTransitions;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user