Open braams opened 4 weeks ago
I'm trying to use jitter buffer interceptor.
I expect to receive RTP packets as usual, but in correct order.
I receive invalid RTP packets. The payload length is more than expected. The payload is filled by zeroes.
The interceptor tries to unmarshal the whole buffer and doesn't respect the actual packet length. https://github.com/pion/interceptor/blob/142f17f90b527434b62ce2fd92676e6e262cd807/pkg/jitterbuffer/receiver_interceptor.go#L77
It looks like we should replace packet.Unmarshal(buf) to packet.Unmarshal(buf[:n])
packet.Unmarshal(buf)
packet.Unmarshal(buf[:n])
Your environment.
What did you do?
I'm trying to use jitter buffer interceptor.
What did you expect?
I expect to receive RTP packets as usual, but in correct order.
What happened?
I receive invalid RTP packets. The payload length is more than expected. The payload is filled by zeroes.
The reason
The interceptor tries to unmarshal the whole buffer and doesn't respect the actual packet length. https://github.com/pion/interceptor/blob/142f17f90b527434b62ce2fd92676e6e262cd807/pkg/jitterbuffer/receiver_interceptor.go#L77
It looks like we should replace
packet.Unmarshal(buf)
topacket.Unmarshal(buf[:n])