Skip to content

Commit

Permalink
fix(dual-output): global rescale output causes stretched stream on ve…
Browse files Browse the repository at this point in the history
…rtical (#5008)

* fix(dual-output): global rescale output causes stretched stream on vertical

* fix: refresh video settings instead of destroy ctx
  • Loading branch information
blackxored authored May 23, 2024
1 parent 9fae4f2 commit 87d1648
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions app/services/dual-output/dual-output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,9 @@ export class DualOutputService extends PersistentStatefulService<IDualOutputServ
// confirm custom destinations have a default display
this.confirmDestinationDisplays();

// Disable global Rescale Output
this.disableGlobalRescaleIfNeeded();

/**
* Ensures that the scene nodes are assigned a context
*/
Expand Down Expand Up @@ -377,6 +380,7 @@ export class DualOutputService extends PersistentStatefulService<IDualOutputServ
this.SET_SHOW_DUAL_OUTPUT(status);

if (this.state.dualOutputMode) {
this.disableGlobalRescaleIfNeeded();
this.confirmOrCreateVerticalNodes(this.views.activeSceneId);

/**
Expand Down Expand Up @@ -413,6 +417,25 @@ export class DualOutputService extends PersistentStatefulService<IDualOutputServ
}
}
}
disableGlobalRescaleIfNeeded() {
// TODO: this could be improved, either by state tracking or making it compatible with dual output
// For now, disable global Rescale Output under Streaming if dual output is enabled
if (this.state.dualOutputMode) {
const output = this.settingsService.state.Output.formData;
const globalRescaleOutput = this.settingsService.findSettingValue(
output,
'Streaming',
'Rescale',
);
if (globalRescaleOutput) {
// `Output` not a typo, it is different from above
this.settingsService.setSettingValue('Output', 'Rescale', false);
// TODO: find a cleaner way to make dual output recalculate its settings for the vertical display
// since even after disabling "rescale output" its settings persists, and looks stretched.
this.settingsService.refreshVideoSettings();
}
}
}

convertSceneSources(sceneId: string) {
const sceneSources = this.scenesService.views.sceneSourcesForScene(sceneId);
Expand Down

0 comments on commit 87d1648

Please sign in to comment.