UI: Block when calling obs_frontend_set_current_scene

Uses WaitConnection() when calling obs_frontend_set_current_scene to
ensure that the calling thread and the UI thread are synchronized when
setting the current scene via this function.

Closes obsproject/obs-studio#1234
This commit is contained in:
Ilya Melamed 2018-05-04 15:43:03 -07:00 committed by jp9000
parent c768f703ad
commit e265fc92ed

View File

@ -93,9 +93,11 @@ struct OBSStudioAPI : obs_frontend_callbacks {
{
if (main->IsPreviewProgramMode()) {
QMetaObject::invokeMethod(main, "TransitionToScene",
WaitConnection(),
Q_ARG(OBSSource, OBSSource(scene)));
} else {
QMetaObject::invokeMethod(main, "SetCurrentScene",
WaitConnection(),
Q_ARG(OBSSource, OBSSource(scene)),
Q_ARG(bool, false));
}