mirror of
https://github.com/aler9/gortsplib
synced 2025-10-08 00:20:05 +08:00
decrease tcp read buffer size
This commit is contained in:
@@ -25,6 +25,7 @@ const (
|
||||
clientReceiverReportPeriod = 10 * time.Second
|
||||
clientUdpCheckStreamPeriod = 5 * time.Second
|
||||
clientUdpKeepalivePeriod = 30 * time.Second
|
||||
clientTcpReadBufferSize = 128 * 1024
|
||||
)
|
||||
|
||||
// Track is a track available in a certain URL.
|
||||
@@ -491,7 +492,7 @@ func (c *ConnClient) Play(u *url.URL) (*Response, error) {
|
||||
|
||||
res, err := func() (*Response, error) {
|
||||
frame := &InterleavedFrame{
|
||||
Content: make([]byte, 0, 512*1024),
|
||||
Content: make([]byte, 0, clientTcpReadBufferSize),
|
||||
}
|
||||
|
||||
// v4lrtspserver sends frames before the response.
|
||||
|
@@ -43,7 +43,7 @@ func main() {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
frame := &gortsplib.InterleavedFrame{Content: make([]byte, 0, 512*1024)}
|
||||
frame := &gortsplib.InterleavedFrame{Content: make([]byte, 0, 128*1024)}
|
||||
|
||||
for {
|
||||
frame.Content = frame.Content[:cap(frame.Content)]
|
||||
|
Reference in New Issue
Block a user