Merge pull request #411 from Lange/fix/fixed-duration-transitions

fix(events): don't advertise a false duration for fixed transitions
This commit is contained in:
Stéphane Lepin 2020-03-04 10:56:14 +01:00 committed by GitHub
commit 9233d4f6dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -387,6 +387,13 @@ int Utils::GetTransitionDuration(obs_source_t* transition) {
return 0;
}
if (obs_transition_fixed(transition)) {
// If this transition has a fixed duration (such as a Stinger),
// we don't currently have a way of retrieving that number.
// For now, return -1 to indicate that we don't know the actual duration.
return -1;
}
OBSSourceAutoRelease destinationScene = obs_transition_get_active_source(transition);
OBSDataAutoRelease destinationSettings = obs_source_get_private_settings(destinationScene);

View File

@ -878,7 +878,9 @@ void WSEvents::TransitionDurationChanged(int ms) {
*
* @return {String} `name` Transition name.
* @return {String} `type` Transition type.
* @return {int} `duration` Transition duration (in milliseconds).
* @return {int} `duration` Transition duration (in milliseconds).
* Will be -1 for any transition with a fixed duration,
* such as a Stinger, due to limitations of the OBS API.
* @return {String} `from-scene` Source scene of the transition
* @return {String} `to-scene` Destination scene of the transition
*