mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 15:16:51 +08:00
client: fix support for ReadBufferCount > 1
This commit is contained in:
24
rtppacketmultibuffer.go
Normal file
24
rtppacketmultibuffer.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package gortsplib
|
||||
|
||||
import (
|
||||
"github.com/pion/rtp"
|
||||
)
|
||||
|
||||
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
|
||||
}
|
Reference in New Issue
Block a user