Additional case of subscribing to a closed track (#1465)
When the publisher stops publishing, the individual receivers would close attached DownTracks first before notifying MediaTrackReceiver callbacks. This means #1454 does not fix the issue entirely since there is still a window when we can subscribe to a closing track.
This commit is contained in:
@@ -89,6 +89,10 @@ func (r *RedReceiver) CanClose() bool {
|
||||
return r.closed.Load() || r.downTrackSpreader.DownTrackCount() == 0
|
||||
}
|
||||
|
||||
func (r *RedReceiver) IsClosed() bool {
|
||||
return r.closed.Load()
|
||||
}
|
||||
|
||||
func (r *RedReceiver) Close() {
|
||||
r.closed.Store(true)
|
||||
for _, dt := range r.downTrackSpreader.ResetAndGetDownTracks() {
|
||||
|
||||
Reference in New Issue
Block a user