From f380e89694368a9b759f004efc9f141ce6280517 Mon Sep 17 00:00:00 2001 From: qydysky Date: Tue, 8 Jun 2021 16:57:42 +0800 Subject: [PATCH] =?utf8?q?=E7=B2=BE=E7=AE=80&=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Reply/F.go | 34 ++++++++-------------------------- demo/config/config_K_v.json | 1 + 2 files changed, 9 insertions(+), 26 deletions(-) diff --git a/Reply/F.go b/Reply/F.go index f6c3e62..81f849a 100644 --- a/Reply/F.go +++ b/Reply/F.go @@ -944,16 +944,7 @@ func Savestreamf(){ if len(links) > 0 && len((*links[0]).Base) > 0 && (*links[0]).Base[0] == 104 {links = links[1:]} - //diff_t - diff_t := int(time.Now().Unix() - savestream.hls_stream.t.Unix()) - if savestream.hls_stream.t.IsZero() {diff_t = 0} - //diff_t too large - if diff_t > 2 { - hls_gen.m4s_list = append(hls_gen.m4s_list, &m4s_link_item{ - Base:"DICONTINUITY", - status:s_fin, - }) - } + hls_gen.m4s_list = append(hls_gen.m4s_list, links...) return false @@ -1234,10 +1225,8 @@ func Savestreamf(){ if F.Get(`Liveing`);!c.Liveing {break} if F.Get(`Live`);len(c.Live) == 0 {break} - // no expect qn - if c.Live_want_qn < c.Live_qn { - expires = time.Now().Add(time.Minute*2).Unix() - } + // set expect + expires = time.Now().Add(time.Minute*2).Unix() continue } @@ -1257,11 +1246,6 @@ func Savestreamf(){ download_limit.Block() defer download_limit.UnBlock() - //wait num - // if wnum := download_limit.WNum();wnum != 0 { - // l.L(`T: `, `处理:`, link.Base) - // } - link.status = s_loading r := reqf.New() if e := r.Reqf(reqf.Rval{ @@ -1308,10 +1292,8 @@ func Savestreamf(){ if p.Sys().GetSTime()+60 > expires { if F.Get(`Liveing`);!c.Liveing {break} if F.Get(`Live`);len(c.Live) == 0 {break} - // no expect qn - if c.Live_want_qn < c.Live_qn { - expires = time.Now().Add(time.Minute*2).Unix() - } + // set expect + expires = time.Now().Add(time.Minute*2).Unix() } else { time.Sleep(time.Second) } @@ -1963,10 +1945,10 @@ func AutoSend_silver_gift() { var m4s_cache sync.Map//使用内存cache避免频繁io -//直播保存位置Web服务 +//直播Web服务口 func init() { flog := flog.Base_add(`直播Web服务`) - if port_f,ok := c.K_v.LoadV(`直播保存位置Web服务`).(float64);ok && port_f >= 0 { + if port_f,ok := c.K_v.LoadV(`直播Web服务口`).(float64);ok && port_f >= 0 { port := int(port_f) base_dir := savestream.base_path @@ -1988,7 +1970,7 @@ func init() { w.Header().Set("Access-Control-Allow-Headers", "*") w.Header().Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS") w.Header().Set("Access-Control-Allow-Origin", "*") - w.Header().Set("Connection", "Keep-Alive") + w.Header().Set("Connection", "keep-alive") w.Header().Set("Content-Transfer-Encoding", "binary") start := time.Now() diff --git a/demo/config/config_K_v.json b/demo/config/config_K_v.json index 8c37ea6..ad01daf 100644 --- a/demo/config/config_K_v.json +++ b/demo/config/config_K_v.json @@ -51,6 +51,7 @@ "直播hls流缓冲": 20, "直播hls流均衡-help":"true:使用所有hls服务器", "直播hls流均衡": true, + "直播Web服务口":0, "ass-help": "只有保存直播流时才考虑生成ass,ass编码默认GB18030(可选utf-8)", "生成Ass弹幕": true, "Ass编码": "GB18030", -- 2.39.2