Skip to content

Commit cffbaa7

Browse files
committed
fix(casparcg): preserve layers when updating channel info without resync
Only clear _currentState.channels when doing a resync (firstConnect || doResync). When updating channel info (videoMode/fps), preserve existing layers that are built up by shared-control feature instead of always clearing them. Addresses PR feedback from @Julusian
1 parent e8ef1a4 commit cffbaa7

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

  • packages/timeline-state-resolver/src/integrations/casparCG

packages/timeline-state-resolver/src/integrations/casparCG/index.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,16 +174,18 @@ export class CasparCGDevice extends DeviceWithState<State, CasparCGDeviceTypes,
174174
firstConnect = false
175175
this.clearStates()
176176
this.emit('resyncStates')
177+
// Clear all state on resync
178+
this._currentState = { channels: {} }
177179
}
178180

179-
// Populate channel info (including fps) after resync decision
180-
this._currentState = { channels: {} }
181+
// Populate/update channel info (including fps), preserving existing layers
181182
for (const obj of channelInfo) {
183+
const existingChannel = this._currentState.channels[obj.channel]
182184
this._currentState.channels[obj.channel] = {
183185
channelNo: obj.channel,
184186
videoMode: this.getVideMode(obj),
185187
fps: obj.frameRate,
186-
layers: {},
188+
layers: existingChannel?.layers || {},
187189
}
188190
}
189191
})

0 commit comments

Comments
 (0)