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.
This commit is contained in:
Raja Subramanian
2026-04-03 00:49:12 +05:30
committed by GitHub
parent 7d06cfca8b
commit c6ddc879e7
+3 -3
View File
@@ -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) {