diff --git a/pkg/nack/generator_interceptor.go b/pkg/nack/generator_interceptor.go index d5f65b5b..f55f4d7f 100644 --- a/pkg/nack/generator_interceptor.go +++ b/pkg/nack/generator_interceptor.go @@ -95,6 +95,9 @@ func (n *GeneratorInterceptor) BindRemoteStream(info *interceptor.StreamInfo, re return 0, nil, err } + if attr == nil { + attr = make(interceptor.Attributes) + } header, err := attr.GetRTPHeader(b[:i]) if err != nil { return 0, nil, err diff --git a/pkg/nack/responder_interceptor.go b/pkg/nack/responder_interceptor.go index 31a24234..396efba2 100644 --- a/pkg/nack/responder_interceptor.go +++ b/pkg/nack/responder_interceptor.go @@ -64,6 +64,9 @@ func (n *ResponderInterceptor) BindRTCPReader(reader interceptor.RTCPReader) int return 0, nil, err } + if attr == nil { + attr = make(interceptor.Attributes) + } pkts, err := attr.GetRTCPPackets(b[:i]) if err != nil { return 0, nil, err diff --git a/pkg/packetdump/receiver_interceptor.go b/pkg/packetdump/receiver_interceptor.go index ef179273..bc7b6f21 100644 --- a/pkg/packetdump/receiver_interceptor.go +++ b/pkg/packetdump/receiver_interceptor.go @@ -44,10 +44,10 @@ func (r *ReceiverInterceptor) BindRemoteStream(info *interceptor.StreamInfo, rea if err != nil { return 0, nil, err } + if attr == nil { attr = make(interceptor.Attributes) } - header, err := attr.GetRTPHeader(bytes) if err != nil { return 0, nil, err @@ -66,10 +66,10 @@ func (r *ReceiverInterceptor) BindRTCPReader(reader interceptor.RTCPReader) inte if err != nil { return 0, nil, err } + if attr == nil { attr = make(interceptor.Attributes) } - pkts, err := attr.GetRTCPPackets(bytes[:i]) if err != nil { return 0, nil, err diff --git a/pkg/report/receiver_interceptor.go b/pkg/report/receiver_interceptor.go index 596c5a9e..cb0e7e1e 100644 --- a/pkg/report/receiver_interceptor.go +++ b/pkg/report/receiver_interceptor.go @@ -129,6 +129,9 @@ func (r *ReceiverInterceptor) BindRemoteStream(info *interceptor.StreamInfo, rea return 0, nil, err } + if attr == nil { + attr = make(interceptor.Attributes) + } header, err := attr.GetRTPHeader(b[:i]) if err != nil { return 0, nil, err @@ -154,6 +157,9 @@ func (r *ReceiverInterceptor) BindRTCPReader(reader interceptor.RTCPReader) inte return 0, nil, err } + if attr == nil { + attr = make(interceptor.Attributes) + } pkts, err := attr.GetRTCPPackets(b[:i]) if err != nil { return 0, nil, err diff --git a/pkg/twcc/sender_interceptor.go b/pkg/twcc/sender_interceptor.go index 9201ae9c..7279228d 100644 --- a/pkg/twcc/sender_interceptor.go +++ b/pkg/twcc/sender_interceptor.go @@ -114,6 +114,10 @@ func (s *SenderInterceptor) BindRemoteStream(info *interceptor.StreamInfo, reade if err != nil { return 0, nil, err } + + if attr == nil { + attr = make(interceptor.Attributes) + } header, err := attr.GetRTPHeader(buf[:i]) if err != nil { return 0, nil, err