From 66733d9a9d88fd28c2691694ddf316fea8ce6dca Mon Sep 17 00:00:00 2001 From: Sam Zagrobelny Date: Sun, 24 Nov 2024 14:29:46 -0500 Subject: [PATCH] fixed bug in examples/rtp-forwarder where packet state is not properly reset on each iteration --- examples/rtp-forwarder/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/rtp-forwarder/main.go b/examples/rtp-forwarder/main.go index 12cd65d1f91..9e8ffd1dd9d 100644 --- a/examples/rtp-forwarder/main.go +++ b/examples/rtp-forwarder/main.go @@ -143,7 +143,6 @@ func main() { } b := make([]byte, 1500) - rtpPacket := &rtp.Packet{} for { // Read n, _, readErr := track.Read(b) @@ -152,6 +151,7 @@ func main() { } // Unmarshal the packet and update the PayloadType + rtpPacket := &rtp.Packet{} if err = rtpPacket.Unmarshal(b[:n]); err != nil { panic(err) }