]> 127.0.0.1 Git - bili_danmu/.git/commitdiff
Fix 避免短时间重复开播导致的重复录制
authorqydysky <32743305+qydysky@users.noreply.github.com>
Fri, 27 Jan 2023 16:43:49 +0000 (00:43 +0800)
committerqydysky <32743305+qydysky@users.noreply.github.com>
Fri, 27 Jan 2023 16:43:49 +0000 (00:43 +0800)
Reply/stream.go

index a18ca68cc2e4157b043471baf2ebfc7620829e4d..ef9dc91bcfd4d4fcba003682f66804e3b94714ec 100644 (file)
@@ -1042,16 +1042,18 @@ func (t *M4SStream) Start() bool {
                return false
        }
 
+       // 实例回调
+       if t.Callback_start != nil {
+               if e := t.Callback_start(t); e != nil {
+                       t.log.L(`W: `, `开始回调错误`, e.Error())
+                       return false
+               }
+       }
+
        t.Status = signal.Init()
        go func() {
                defer t.Status.Done()
 
-               // 实例回调
-               if t.Callback_start != nil {
-                       if e := t.Callback_start(t); e != nil {
-                               t.log.L(`W: `, `开始回调错误`, e.Error())
-                       }
-               }
                if t.Callback_stop != nil {
                        defer t.Callback_stop(t)
                }