UI: Reset VCam when clearing scene data

This commit is contained in:
derrod 2023-05-13 17:19:00 +02:00 • committed by Ryan Foster
commit dfc35603cf
3 changed files with 18 additions and 3 deletions

View file

@ -1280,7 +1280,7 @@ retryScene:
disableSaving--;
if (vcamEnabled && vcamConfig.internal == VCamInternalType::Preview)
if (vcamEnabled)
outputHandler->UpdateVirtualCamOutputSource();
if (api) {
@ -4857,6 +4857,14 @@ void OBSBasic::ClearSceneData()
for (int i = 0; i < MAX_CHANNELS; i++)
obs_set_output_source(i, nullptr);
/* Reset VCam to default to clear its private scene and any references
* it holds. It will be reconfigured during loading. */
if (vcamEnabled) {
vcamConfig.type = VCamOutputType::InternalOutput;
vcamConfig.internal = VCamInternalType::Default;
outputHandler->UpdateVirtualCamOutputSource();
}
lastScene = nullptr;
swapScene = nullptr;
programScene = nullptr;