]> 127.0.0.1 Git - bili_danmu/.git/commitdiff
Fix 录制了错误的数据 #115
authorqydysky <qydysky@foxmail.com>
Tue, 2 Apr 2024 17:27:59 +0000 (01:27 +0800)
committerqydysky <qydysky@foxmail.com>
Tue, 2 Apr 2024 17:27:59 +0000 (01:27 +0800)
Reply/stream.go
go.mod
go.sum

index d426173300030d3f1d6258959c0e836a880eefba..9c2042bc66ddd0fe6c1672e498ff6402fac37ef6 100644 (file)
@@ -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 34782c219ff083c6366c5d7b97f1b96044c97ce8..72c2f28c9ed60cbc36679238c6543c8c58178128 100644 (file)
--- 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 622e9fc001ff771a2a28ff1eade7e2dbc95fa2fd..07b9dd41451c62c56252de86eb1d96f9334d3384 100644 (file)
--- 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=