decrease tcp read buffer size

This commit is contained in:
aler9
2020-08-07 11:32:01 +02:00
parent 3b14ef755b
commit e4217cd9da
2 changed files with 3 additions and 2 deletions

View File

@@ -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.

View File

@@ -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)]