From 6933ea18b2cc276e8de39bc0082d6ca0e0a8fe82 Mon Sep 17 00:00:00 2001 From: qydysky Date: Wed, 3 Apr 2024 01:27:59 +0800 Subject: [PATCH] =?utf8?q?Fix=20=20=E5=BD=95=E5=88=B6=E4=BA=86=E9=94=99?= =?utf8?q?=E8=AF=AF=E7=9A=84=E6=95=B0=E6=8D=AE=20#115?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Reply/stream.go | 8 +++++--- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Reply/stream.go b/Reply/stream.go index d426173..9c2042b 100644 --- a/Reply/stream.go +++ b/Reply/stream.go @@ -897,7 +897,9 @@ func (t *M4SStream) saveStreamM4s() (e error) { { // 防止过快的下载 dru := time.Since(startT).Seconds() - if wait := float64(fmp4Count) - dru - 1; wait > 2 { + if wait := float64(fmp4Count) - dru - 1; wait > 5 { + time.Sleep(time.Second * 5) + } else if wait > 2 { time.Sleep(time.Duration(wait) * time.Second) } else { time.Sleep(time.Second * 2) @@ -1359,7 +1361,7 @@ func (t *M4SStream) PusherToFile(contextC context.Context, filepath string, star defer done() _, _ = f.Write(t.getFirstBuf(), true) - cancelRec := t.Stream_msg.Pull_tag_async_order(map[string]func([]byte) bool{ + cancelRec := t.Stream_msg.Pull_tag(map[string]func([]byte) bool{ `data`: func(b []byte) bool { select { case <-contextC.Done(): @@ -1446,7 +1448,7 @@ func (t *M4SStream) PusherToHttp(conn net.Conn, w http.ResponseWriter, r *http.R return err } - var cancelRec = t.Stream_msg.Pull_tag_async_order(map[string]func([]byte) bool{ + var cancelRec = t.Stream_msg.Pull_tag(map[string]func([]byte) bool{ `data`: func(b []byte) bool { select { case <-r.Context().Done(): diff --git a/go.mod b/go.mod index 34782c2..72c2f28 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.22 require ( github.com/gotk3/gotk3 v0.6.3 github.com/mdp/qrterminal/v3 v3.2.0 - github.com/qydysky/part v0.28.20240402154002 + github.com/qydysky/part v0.28.20240402171049 github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 golang.org/x/text v0.14.0 diff --git a/go.sum b/go.sum index 622e9fc..07b9dd4 100644 --- a/go.sum +++ b/go.sum @@ -37,8 +37,8 @@ github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdh github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/qydysky/part v0.28.20240402154002 h1:hx1PnsXysltox5xSb2asl3I9bY87ar3LF78lcFgVg8Q= -github.com/qydysky/part v0.28.20240402154002/go.mod h1:XytV5dI1Y7+qvjhsa2TMvi55RBZQQf0LCDYQ1kUCYqM= +github.com/qydysky/part v0.28.20240402171049 h1:gy306j9TM3pM+MOGAZWXna62IAPhfEBj754orMVvEOo= +github.com/qydysky/part v0.28.20240402171049/go.mod h1:XytV5dI1Y7+qvjhsa2TMvi55RBZQQf0LCDYQ1kUCYqM= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= -- 2.39.2