revert canclose method of red receivers (#1142)

This commit is contained in:
cnderrauber
2022-11-03 15:30:04 +08:00
committed by GitHub
parent 4d480fc05b
commit 34fd1a02e3
2 changed files with 8 additions and 0 deletions
+4
View File
@@ -88,6 +88,10 @@ func (r *RedPrimaryReceiver) DeleteDownTrack(subscriberID livekit.ParticipantID)
r.downTrackSpreader.Free(subscriberID)
}
func (r *RedPrimaryReceiver) CanClose() bool {
return r.closed.Load() || r.downTrackSpreader.DownTrackCount() == 0
}
func (r *RedPrimaryReceiver) Close() {
r.closed.Store(true)
for _, dt := range r.downTrackSpreader.ResetAndGetDownTracks() {
+4
View File
@@ -85,6 +85,10 @@ func (r *RedReceiver) DeleteDownTrack(subscriberID livekit.ParticipantID) {
r.downTrackSpreader.Free(subscriberID)
}
func (r *RedReceiver) CanClose() bool {
return r.closed.Load() || r.downTrackSpreader.DownTrackCount() == 0
}
func (r *RedReceiver) Close() {
r.closed.Store(true)
for _, dt := range r.downTrackSpreader.ResetAndGetDownTracks() {