From bcf178526e636b7d5805f5c41a6ed8fe0eab91e8 Mon Sep 17 00:00:00 2001 From: qydysky Date: Thu, 3 Aug 2023 05:44:57 +0800 Subject: [PATCH] =?utf8?q?Improve=20flv=E9=BB=98=E8=AE=A4=E8=B6=85?= =?utf8?q?=E6=97=B6=E6=97=B6=E9=95=BF=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Reply/stream.go | 4 ++-- demo/config/config_K_v.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Reply/stream.go b/Reply/stream.go index 6958cd5..617d240 100644 --- a/Reply/stream.go +++ b/Reply/stream.go @@ -709,7 +709,7 @@ func (t *M4SStream) saveStreamFlv() (e error) { pipe := pio.NewPipe() var ( leastReadUnix atomic.Int64 - readTO int64 = 5 + readTO int64 = 3 ) leastReadUnix.Store(time.Now().Unix()) if v, ok := t.common.K_v.LoadV(`flv断流超时s`).(float64); ok && int64(v) > readTO { @@ -728,7 +728,7 @@ func (t *M4SStream) saveStreamFlv() (e error) { case curT := <-timer.C: if curT.Unix()-leastReadUnix.Load() > readTO { t.log.L(`W: `, fmt.Sprintf("%vs未接收到有效数据", readTO)) - // 5s未接收到任何数据 + // 时间段内未接收到任何数据 cancel() return } diff --git a/demo/config/config_K_v.json b/demo/config/config_K_v.json index 689ee93..ca81e36 100644 --- a/demo/config/config_K_v.json +++ b/demo/config/config_K_v.json @@ -69,7 +69,7 @@ "直播流清晰度": 10000, "直播流类型-help": "flv,fmp4,flvH,fmp4H,带H后缀的为Hevc格式编码", "直播流类型": "flv", - "flv断流超时s": 7, + "flv断流超时s": 3, "flv断流续接": true, "fmp4切片下载超时s": 3, "直播流保存位置": "./live", -- 2.39.2