StreamSwitchSmoothNode.endCurrentSource() method

End the currently active source immediately. The engine fires a synthetic PreloadEnded for the active pin, which surfaces as the existing onSourceEnded(pin, lastSeenPts) callback with lastSeenPts set to the source’s last rebased output PTS (engine’s state.latestOutputPts captured atomically at the synthetic-end moment).

After this call, no further frames from the just-ended pin flow downstream — the engine inserts the tag into its trimmedSources map so any in-flight upstream frames are silently dropped at processInput.

Useful for cross-node manual cuts where the caller wants to anchor the next node’s releasePreloaded at the just-ended source’s PTS (e.g. an HSS downstream alternating between SSS- and SSQ-output — the SSS’s lastSeenPts becomes the SSQ’s anchorPts).

Idempotent — calling a second time while the tag is already ended is a silent no-op (logged engine-side, no callback re-fires). No-op when there is no active source.

Signature:

endCurrentSource(): Promise<void>;

Returns:

Promise<void>