From c6ddc879e7090afbf9dfe319f348c4b1702dcb9b Mon Sep 17 00:00:00 2001 From: Raja Subramanian Date: Fri, 3 Apr 2026 00:49:12 +0530 Subject: [PATCH] isExpectedToResume is based on whether flushing or not. (#4425) For a participant migrating out, the track could be resumed on a different node, but ending on the migrating out node. So, `flush` should be used to indicate if track is going to be resumed. --- pkg/sfu/downtrack.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/sfu/downtrack.go b/pkg/sfu/downtrack.go index 4eb148a80..adf264cf6 100644 --- a/pkg/sfu/downtrack.go +++ b/pkg/sfu/downtrack.go @@ -1406,9 +1406,9 @@ func (d *DownTrack) Close() { d.CloseWithFlush(true, true) } -// CloseWithFlush - flush used to indicate whether send blank frame to flush +// CloseWithFlush - `flush` used to indicate whether send blank frame to flush // decoder of client. -// 1. When transceiver is reused by other participant's video track, +// 1. When transceiver of this track is reused by some other participant's video track, // set flush=true to avoid previous video shows before new stream is displayed. // 2. in case of session migration, participant migrate from other node, video track should // be resumed with same participant, set flush=false since we don't need to flush decoder. @@ -1483,7 +1483,7 @@ func (d *DownTrack) CloseWithFlush(flush bool, isEnding bool) { close(d.keyFrameRequesterCh) d.keyFrameRequesterChMu.Unlock() - d.params.Listener.OnDownTrackClose(!isEnding) + d.params.Listener.OnDownTrackClose(!flush) } func (d *DownTrack) SetMaxSpatialLayer(spatialLayer int32) {