UI: Update profile encoder information after module load

The function InitBasicConfigDefaults2's purpose is to set up encoder-
related settings for a profile, which requires all available encoders
to have been discovered first.

As encoders are added by runtime modules, this also means that discovery
needs to be delayed until after modules have been loaded, but modules
themselves require a valid profile to exist and be loaded.

This leads to the requirement of profiles needing to exist in a
half-initialized state when modules are loaded and only becoming
fully initialized after that.

This distinction is not necessary after the initial launch of obs-studio
because runtime plugins are not hot-loadable, so the update can happen
unconditionally at any time a plugin is changed, which implicitly
couples every call to ActivateProfile with a call to
UpdateProfileEncoders.
This commit is contained in:
PatTheMav
2024-10-29 16:10:27 +01:00
committed by Ryan Foster
parent 0be9d9ff79
commit bf00c17b2b
3 changed files with 10 additions and 7 deletions

View File

@@ -1898,7 +1898,7 @@ bool OBSBasic::InitBasicConfig()
return false;
}
return InitBasicConfigDefaults();
return true;
}
void OBSBasic::InitOBSCallbacks()
@@ -2123,9 +2123,7 @@ void OBSBasic::OBSInit()
emit VirtualCamEnabled();
}
InitBasicConfigDefaults2();
CheckForSimpleModeX264Fallback();
UpdateProfileEncoders();
LogEncoders();