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