Skip to content

Commit

Permalink
frontend: Reduce SetCurrentTransition calls
Browse files Browse the repository at this point in the history
  • Loading branch information
tytan652 committed Feb 18, 2025
1 parent 29307e8 commit 6985616
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions frontend/widgets/OBSBasic_Transitions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,16 @@ void OBSBasic::InitDefaultTransitions()
}
}

/* FIXME: Reduce SetCurrentTransition calls */
for (OBSSource &tr : defaultTransitions) {
std::string uuid = obs_source_get_uuid(tr);

transitions.insert({uuid, tr});
transitionNameToUuids.insert({obs_source_get_name(tr), uuid});

emit TransitionAdded(QT_UTF8(obs_source_get_name(tr)), QString::fromStdString(uuid));

SetCurrentTransition(uuid);
}

SetCurrentTransition(trUuids.back());

Check failure on line 82 in frontend/widgets/OBSBasic_Transitions.cpp

View workflow job for this annotation

GitHub Actions / Build 🧱 / macOS 🍏 (arm64)

use of undeclared identifier 'trUuids'

Check failure on line 82 in frontend/widgets/OBSBasic_Transitions.cpp

View workflow job for this annotation

GitHub Actions / Build 🧱 / macOS 🍏 (x86_64)

use of undeclared identifier 'trUuids'
}

void OBSBasic::AddQuickTransitionHotkey(QuickTransition *qt)
Expand Down Expand Up @@ -1350,7 +1349,6 @@ void OBSBasic::LoadTransitions(obs_data_array_t *transitionsData, obs_load_sourc
size_t count = obs_data_array_count(transitionsData);

safeModeTransitions.clear();
/* FIXME: Reduce SetCurrentTransition calls */
for (size_t i = 0; i < count; i++) {
OBSDataAutoRelease item = obs_data_array_item(transitionsData, i);
const char *name = obs_data_get_string(item, "name");
Expand All @@ -1368,13 +1366,14 @@ void OBSBasic::LoadTransitions(obs_data_array_t *transitionsData, obs_load_sourc

emit TransitionAdded(QT_UTF8(name), QString::fromStdString(uuid));

SetCurrentTransition(uuid);
if (cb)
cb(private_data, source);
} else if (safe_mode || disable_3p_plugins) {
safeModeTransitions.push_back(std::move(item));
}
}

SetCurrentTransition(trUuids.back());

Check failure on line 1376 in frontend/widgets/OBSBasic_Transitions.cpp

View workflow job for this annotation

GitHub Actions / Build 🧱 / macOS 🍏 (arm64)

use of undeclared identifier 'trUuids'

Check failure on line 1376 in frontend/widgets/OBSBasic_Transitions.cpp

View workflow job for this annotation

GitHub Actions / Build 🧱 / macOS 🍏 (x86_64)

use of undeclared identifier 'trUuids'
}

OBSSource OBSBasic::GetOverrideTransition(OBSSource source)
Expand Down

0 comments on commit 6985616

Please sign in to comment.