Files
gortsplib/rtppacketmultibuffer.go
aler9 e12b22ae77 fix encoding of RTP packets with padding
this fixes a SIGSEGV with GStreamer
2022-03-08 12:47:55 +01:00

25 lines
423 B
Go

package gortsplib
import (
"github.com/pion/rtp/v2"
)
type rtpPacketMultiBuffer struct {
count uint64
buffers []rtp.Packet
cur uint64
}
func newRTPPacketMultiBuffer(count uint64) *rtpPacketMultiBuffer {
return &rtpPacketMultiBuffer{
count: count,
buffers: make([]rtp.Packet, count),
}
}
func (mb *rtpPacketMultiBuffer) next() *rtp.Packet {
ret := &mb.buffers[mb.cur%mb.count]
mb.cur++
return ret
}