修改rtsp自动拉流配置结构

This commit is contained in:
langhuihui
2021-07-11 21:43:15 +08:00
parent f0a00f3db9
commit 5cdbc220de
4 changed files with 10 additions and 14 deletions

View File

@@ -21,10 +21,7 @@ var config = struct {
RemoteAddr string
Timeout int
Reconnect bool
AutoPullList []*struct {
URL string
StreamPath string
}
AutoPullList map[string]string
}{":554", false, "rtsp://localhost/${streamPath}", 0, false, nil}
func init() {
@@ -65,8 +62,8 @@ func runPlugin() {
}
})
if len(config.AutoPullList) > 0 {
for _, info := range config.AutoPullList {
if err := new(RTSP).PullStream(info.StreamPath, info.URL); err != nil {
for streamPath, url := range config.AutoPullList {
if err := new(RTSP).PullStream(streamPath, url); err != nil {
Println(err)
}
}