From 93973f247912b86ba002b0f7ae5b3bec04a8e2a2 Mon Sep 17 00:00:00 2001 From: langhuihui <178529795@qq.com> Date: Wed, 13 Dec 2023 15:26:00 +0800 Subject: [PATCH] feat: add desc to config --- main.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index 87b1630..dc7523f 100644 --- a/main.go +++ b/main.go @@ -18,8 +18,8 @@ type RTMPConfig struct { config.TCP config.Pull config.Push - ChunkSize int - KeepAlive bool //保持rtmp连接,默认随着stream的close而主动断开 + ChunkSize int `default:"65535" desc:"分片大小"` + KeepAlive bool `desc:"保持连接,流断开不关闭连接"` //保持rtmp连接,默认随着stream的close而主动断开 } func pull(streamPath, url string) { @@ -47,15 +47,14 @@ func (c *RTMPConfig) OnEvent(event any) { } } case InvitePublish: //按需拉流 - if remoteURL := conf.CheckPullOnSub(v.Target); remoteURL != "" { + if remoteURL := conf.CheckPullOnSub(v.Target); remoteURL != "" { pull(v.Target, remoteURL) } } } var conf = &RTMPConfig{ - ChunkSize: 65536, - TCP: config.TCP{ListenAddr: ":1935"}, + TCP: config.TCP{ListenAddr: ":1935"}, } var RTMPPlugin = InstallPlugin(conf)