Fix extended sequence abort when using non-instant transitions

This commit is contained in:
WarmUpTill 2021-07-29 15:47:40 -07:00 committed by GitHub
parent 87aa8d3b40
commit 1474509cb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 6 deletions

View File

@ -35,8 +35,7 @@ struct SceneSequenceSwitch : SceneSwitcherEntry {
bool reduce();
SceneSequenceSwitch *extend();
bool checkMatch(OBSWeakSource currentScene, int &linger,
SceneSequenceSwitch *root = nullptr);
bool checkMatch(int &linger, SceneSequenceSwitch *root = nullptr);
bool checkDurationMatchInterruptible();
void prepareUninterruptibleMatch(int &linger);
void advanceActiveSequence();

View File

@ -203,7 +203,7 @@ bool SwitcherData::checkSceneSequence(OBSWeakSource &scene,
continue;
}
bool matched = s.checkMatch(currentScene, linger);
bool matched = s.checkMatch(linger);
if (!match && matched) {
match = matched;
@ -395,8 +395,7 @@ SceneSequenceSwitch *SceneSequenceSwitch::extend()
return extendedSequence.get();
}
bool SceneSequenceSwitch::checkMatch(OBSWeakSource currentScene, int &linger,
SceneSequenceSwitch *root)
bool SceneSequenceSwitch::checkMatch(int &linger, SceneSequenceSwitch *root)
{
if (!initialized()) {
if (root) {
@ -407,8 +406,18 @@ bool SceneSequenceSwitch::checkMatch(OBSWeakSource currentScene, int &linger,
bool match = false;
// We cannot rely on switcher->currentScene for this information.
// Depending on the transition length the frontend event for the scene
// change of the previous element in the sequence might not yet have
// been received, which would lead to the sequencence being aborted.
// Thus we have to use obs_frontend_get_current_scene() here.
auto sceneSource = obs_frontend_get_current_scene();
auto currentScene = obs_source_get_weak_source(sceneSource);
obs_weak_source_release(currentScene);
obs_source_release(sceneSource);
if (activeSequence) {
return activeSequence->checkMatch(currentScene, linger, this);
return activeSequence->checkMatch(linger, this);
}
if (startScene == currentScene) {