防止json循环引用

This commit is contained in:
langhuihui
2021-07-24 11:38:24 +08:00
parent da2fc9d462
commit 9aec4ec4be
2 changed files with 2 additions and 2 deletions

View File

@@ -268,7 +268,6 @@ func (client *RTSP) startStream() {
//loggerTime := time.Now().Add(-10 * time.Second) //loggerTime := time.Now().Add(-10 * time.Second)
defer func() { defer func() {
if client.Err() == nil && config.Reconnect { if client.Err() == nil && config.Reconnect {
Printf("reconnecting:%s", client.URL)
client.RTSPClientInfo = RTSPClientInfo{} client.RTSPClientInfo = RTSPClientInfo{}
Printf("reconnecting:%s in 5 seconds", client.URL) Printf("reconnecting:%s in 5 seconds", client.URL)
time.AfterFunc(time.Second*5, client.startStream) time.AfterFunc(time.Second*5, client.startStream)
@@ -277,6 +276,7 @@ func (client *RTSP) startStream() {
} }
}() }()
if err := client.requestStream(); err != nil { if err := client.requestStream(); err != nil {
Printf("rtsp requestStream err:%v", err)
return return
} }
for client.Err() == nil { for client.Err() == nil {

View File

@@ -110,7 +110,7 @@ func ListenRtsp(addr string) error {
} }
type RTSP struct { type RTSP struct {
*Stream *Stream `json:"-"`
URL string URL string
SDPRaw string SDPRaw string
InBytes int InBytes int