diff --git a/pkg/report/receiver_interceptor.go b/pkg/report/receiver_interceptor.go index c126f9ab..39606f80 100644 --- a/pkg/report/receiver_interceptor.go +++ b/pkg/report/receiver_interceptor.go @@ -142,8 +142,8 @@ func (r *ReceiverInterceptor) BindRemoteStream(info *interceptor.StreamInfo, rea }) } -// UnbindLocalStream is called when the Stream is removed. It can be used to clean up any data related to that track. -func (r *ReceiverInterceptor) UnbindLocalStream(info *interceptor.StreamInfo) { +// UnbindRemoteStream is called when the Stream is removed. It can be used to clean up any data related to that track. +func (r *ReceiverInterceptor) UnbindRemoteStream(info *interceptor.StreamInfo) { r.streams.Delete(info.SSRC) } diff --git a/pkg/report/sender_interceptor.go b/pkg/report/sender_interceptor.go index 087838e7..a19ac367 100644 --- a/pkg/report/sender_interceptor.go +++ b/pkg/report/sender_interceptor.go @@ -144,3 +144,8 @@ func (s *SenderInterceptor) BindLocalStream(info *interceptor.StreamInfo, writer return writer.Write(header, payload, a) }) } + +// UnbindLocalStream is called when the Stream is removed. It can be used to clean up any data related to that track. +func (s *SenderInterceptor) UnbindLocalStream(info *interceptor.StreamInfo) { + s.streams.Delete(info.SSRC) +}