]> 127.0.0.1 Git - bili_danmu/.git/commitdiff
Fix stopRec事件录制停止
authorqydysky <qydysky@foxmail.com>
Sun, 9 Apr 2023 17:45:52 +0000 (01:45 +0800)
committerqydysky <qydysky@foxmail.com>
Sun, 9 Apr 2023 17:45:52 +0000 (01:45 +0800)
Reply/stream.go

index 8a1a1133048e9bbc08cae394143af43b520bab18..fa8ce8b61f961f701cdcbbe441ccea229f6ab985 100644 (file)
@@ -1151,6 +1151,12 @@ func (t *M4SStream) Start() bool {
                                        contextC, cancle := context.WithCancel(mainContextC)
                                        fc.FlashWithCallback(cancle)
 
+                                       // 当stopRec时,取消录制
+                                       ms.msg.Pull_tag_only("stopRec", func(_ *M4SStream) (disable bool) {
+                                               cancle()
+                                               return true
+                                       })
+
                                        l := ms.log.Base_add(`文件`)
                                        startf := func(_ *M4SStream) error {
                                                l.L(`T: `, `start`)