mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 07:06:58 +08:00
client: fix support for ReadBufferCount > 1
This commit is contained in:
@@ -9,32 +9,11 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/pion/rtcp"
|
||||
"github.com/pion/rtp"
|
||||
"golang.org/x/net/ipv4"
|
||||
|
||||
"github.com/aler9/gortsplib/pkg/multibuffer"
|
||||
)
|
||||
|
||||
type rtpPacketMultiBuffer struct {
|
||||
count uint64
|
||||
buffers []rtp.Packet
|
||||
cur uint64
|
||||
}
|
||||
|
||||
func newRTPPacketMultiBuffer(count uint64) *rtpPacketMultiBuffer {
|
||||
buffers := make([]rtp.Packet, count)
|
||||
return &rtpPacketMultiBuffer{
|
||||
count: count,
|
||||
buffers: buffers,
|
||||
}
|
||||
}
|
||||
|
||||
func (mb *rtpPacketMultiBuffer) next() *rtp.Packet {
|
||||
ret := &mb.buffers[mb.cur%mb.count]
|
||||
mb.cur++
|
||||
return ret
|
||||
}
|
||||
|
||||
type clientData struct {
|
||||
ss *ServerSession
|
||||
trackID int
|
||||
|
Reference in New Issue
Block a user