diff --git a/client.go b/client.go index 3dfb361..0bb1e66 100644 --- a/client.go +++ b/client.go @@ -151,7 +151,7 @@ func (client *RTSPClient) pullStream() { f(append(clone, payload...)) } }, - ReadBufferSize: 10000, + ReadBufferSize: config.ReadBufferSize, Transport: &client.Transport, } // parse URL diff --git a/main.go b/main.go index ee34a66..5bc7b52 100644 --- a/main.go +++ b/main.go @@ -13,14 +13,15 @@ import ( ) var config = struct { - ListenAddr string - UDPAddr string - RTCPAddr string - Timeout int - Reconnect bool - AutoPullList map[string]string - AutoPushList map[string]string -}{":554", ":8000", ":8001", 0, false, nil, nil} + ListenAddr string + UDPAddr string + RTCPAddr string + Timeout int + Reconnect bool + AutoPullList map[string]string + AutoPushList map[string]string + ReadBufferSize int +}{":554", ":8000", ":8001", 0, false, nil, nil, 2048} var pconfig = PluginConfig{ Name: "RTSP", @@ -84,7 +85,7 @@ func runPlugin() { Println(err) } } - + go AddHook(HOOK_PUBLISH, func(s *Stream) { for streamPath, url := range config.AutoPushList { if s.StreamPath == streamPath {