Skip to content

Commit

Permalink
Unbind stream for report interceptor
Browse files Browse the repository at this point in the history
UnbindLocalStream for Sender
UnbindRemoteStream for Receiver
  • Loading branch information
cnderrauber committed Jan 31, 2024
1 parent d9d223e commit 284411c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/report/receiver_interceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Check warning on line 146 in pkg/report/receiver_interceptor.go

View check run for this annotation

Codecov / codecov/patch

pkg/report/receiver_interceptor.go#L146

Added line #L146 was not covered by tests
r.streams.Delete(info.SSRC)
}

Expand Down
5 changes: 5 additions & 0 deletions pkg/report/sender_interceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Check warning on line 150 in pkg/report/sender_interceptor.go

View check run for this annotation

Codecov / codecov/patch

pkg/report/sender_interceptor.go#L149-L150

Added lines #L149 - L150 were not covered by tests
}
2 changes: 1 addition & 1 deletion pkg/rfc8888/recorder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func TestNTPTime32(t *testing.T) {
},
{
input: notSoLongAgo,
expected: uint32(int(notSoLongAgo.Sub(zero).Seconds())&0xffff) << 16,
expected: uint32(uint(notSoLongAgo.Sub(zero).Seconds())&0xffff) << 16,
},
{
input: zero.Add(400 * time.Millisecond),
Expand Down

0 comments on commit 284411c

Please sign in to comment.