mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-07-24 12:40:47 -05:00
fix media states being retriggered multiple times (#54)
This commit is contained in:
parent
1a3ed0d09c
commit
8e26148255
|
|
@ -18,6 +18,9 @@ struct MediaSwitch : SceneSwitcherEntry {
|
|||
bool anyState = false;
|
||||
time_restriction restriction = TIME_RESTRICTION_NONE;
|
||||
int64_t time = 0;
|
||||
|
||||
bool matched = false;
|
||||
|
||||
std::atomic<bool> stopped = false;
|
||||
std::atomic<bool> ended = false;
|
||||
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ void SwitcherData::checkMediaSwitch(bool &match, OBSWeakSource &scene,
|
|||
|
||||
bool matched = matchedState && matchedTime;
|
||||
|
||||
if (matched) {
|
||||
if (matched && !mediaSwitch.matched) {
|
||||
match = true;
|
||||
scene = (mediaSwitch.usePreviousScene)
|
||||
? previousScene
|
||||
|
|
@ -160,8 +160,12 @@ void SwitcherData::checkMediaSwitch(bool &match, OBSWeakSource &scene,
|
|||
|
||||
if (verbose)
|
||||
mediaSwitch.logMatch();
|
||||
break;
|
||||
}
|
||||
|
||||
mediaSwitch.matched = matched;
|
||||
|
||||
if (match)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user