Skip to content

Commit

Permalink
fix panic nil on remote track
Browse files Browse the repository at this point in the history
  • Loading branch information
Yohan Totting committed Apr 8, 2024
1 parent 0ec3c3a commit 8493203
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions remotetrack.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,8 @@ func (t *remoteTrack) readRTP() {
if t.Track().Kind() == webrtc.RTPCodecTypeVideo {
// video needs to be reordered
retainablePacket := rtppool.NewPacket(&p.Header, p.Payload)
if err := t.packetBuffers.Add(retainablePacket); err != nil {
retainablePacket.Release()
}
_ = t.packetBuffers.Add(retainablePacket)

} else {
// audio doesn't need to be reordered
t.onRead(p)
Expand Down

0 comments on commit 8493203

Please sign in to comment.