From 70f1d4f7edf3b414c8bcb66113e40a27c509b835 Mon Sep 17 00:00:00 2001 From: qydysky Date: Sun, 21 Jan 2024 22:57:24 +0800 Subject: [PATCH] =?utf8?q?Improve=20=E6=B7=BB=E5=8A=A0=E5=90=AF=E5=8A=A8?= =?utf8?q?=E5=88=86=E6=AE=B5=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Reply/stream.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Reply/stream.go b/Reply/stream.go index 56d4992..270d6f1 100644 --- a/Reply/stream.go +++ b/Reply/stream.go @@ -1263,11 +1263,13 @@ func (t *M4SStream) Start() bool { // 分段时长min if l, ok := ms.common.K_v.LoadV("分段时长min").(float64); ok && l > 0 { - tc := time.AfterFunc(time.Duration(int64(time.Minute)*int64(l)), func() { - ms.log.Base_add(`分段`).L(`I: `, ms.common.Roomid, "ok") + cutT := time.Duration(int64(time.Minute) * int64(l)) + ml := ms.log.Base_add(`分段`) + ml.L(`I: `, fmt.Sprintf("分段启动 %v", cutT)) + defer time.AfterFunc(cutT, func() { + ml.L(`I: `, ms.common.Roomid, "ok") ms.msg.Push_tag(`cut`, ms) - }) - defer tc.Stop() + }).Stop() } // 当stopRec时,取消录制 -- 2.39.2