From 66548b4be870b868829ac29275f9315afe0ab8b0 Mon Sep 17 00:00:00 2001 From: qydysky <32743305+qydysky@users.noreply.github.com> Date: Sun, 18 Sep 2022 20:05:33 +0800 Subject: [PATCH] =?utf8?q?=E9=87=8D=E5=A4=8D=E5=BD=95=E5=88=B6=E4=BF=AE?= =?utf8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Reply/F.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Reply/F.go b/Reply/F.go index 675c5ad..57543b6 100644 --- a/Reply/F.go +++ b/Reply/F.go @@ -252,7 +252,7 @@ func dtos(t time.Duration) string { // hls // https://datatracker.ietf.org/doc/html/draft-pantos-http-live-streaming -var streamO = new(psync.Map) +var streamO = new(sync.Map) // 获取实例的Common func StreamOCommon(roomid int) (array []c.Common) { @@ -303,6 +303,10 @@ func init() { v.(*M4SStream).Stop() streamO.Delete(item.Roomid) } + } else if !ok { + flog.L(`W: `, `未录制 `+strconv.Itoa(item.Roomid)+` 不能停止`) + } else { + flog.L(`W: `, `已录制 `+strconv.Itoa(item.Roomid)+` 不能重复录制`) } } return false @@ -337,7 +341,7 @@ func StreamOStop(roomid int) { } return true }) - streamO = new(psync.Map) + streamO = new(sync.Map) default: // 针对某房间 if v, ok := streamO.Load(roomid); ok { if v.(*M4SStream).Status.Islive() { -- 2.39.2