]> 127.0.0.1 Git - bili_danmu/.git/commitdiff
Fix windows error (#177)
authorqydysky <qydysky@foxmail.com>
Tue, 25 Feb 2025 17:07:51 +0000 (01:07 +0800)
committerGitHub <noreply@github.com>
Tue, 25 Feb 2025 17:07:51 +0000 (01:07 +0800)
* Fix windows error (#176)

* 1

Reply/stream.go
go.mod
go.sum

index 9b737115ce99a7efe5dd3a11abb79f606245907d..cc49ea6818fd665c9e5f84b51b213eb170a7e021 100644 (file)
@@ -1378,11 +1378,9 @@ func (t *M4SStream) Start() bool {
                                                return false
                                        }
 
-                                       ctx, cancel := context.WithCancel(mainCtx)
-                                       fc.FlashWithCallback(cancel)
-
                                        // 当cut时,取消上次录制
-                                       ctx1, done := pctx.WithWait(ctx, 3, time.Second*30)
+                                       ctx1, done := pctx.WithWait(mainCtx, 3, time.Second*30)
+                                       fc.FlashWithCallback(func() { _ = done() })
 
                                        // 分段时长min
                                        if l, ok := ms.common.K_v.LoadV("分段时长min").(float64); ok && l > 0 {
@@ -1437,7 +1435,7 @@ func (t *M4SStream) Start() bool {
                                        duration := time.Since(startT)
 
                                        // wait all goroutine exit
-                                       if e := done(); e != nil {
+                                       if e := done(); e != nil && !errors.Is(e, pctx.ErrDoneCalled) {
                                                l.L(`E: `, e)
                                        }
 
diff --git a/go.mod b/go.mod
index 184eedb55d84e6c45bcf3abfca08d2733ff50a9e..4d12711c11b8739bc3355f2e6cfab7f4ece8b116 100644 (file)
--- a/go.mod
+++ b/go.mod
@@ -5,7 +5,7 @@ go 1.24
 require (
        github.com/gotk3/gotk3 v0.6.4
        github.com/mdp/qrterminal/v3 v3.2.0
-       github.com/qydysky/part v0.28.20250225073648
+       github.com/qydysky/part v0.28.20250225161111
        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.22.0 // indirect
diff --git a/go.sum b/go.sum
index 76988f0781664ef8c0a1c5d6668ae5d3913678e5..4365d3f1db43efd4463658b741cda6efbd4cc5eb 100644 (file)
--- a/go.sum
+++ b/go.sum
@@ -46,8 +46,8 @@ github.com/qydysky/biliApi v0.0.0-20240725184407-15076dddb6fb h1:dtSpNF9hLQa09TU
 github.com/qydysky/biliApi v0.0.0-20240725184407-15076dddb6fb/go.mod h1:om024vfxALQ5vxsbaGoMm8IS0esLYBnEOpJI8FsGoDg=
 github.com/qydysky/brotli v0.0.0-20240828134800-e9913a6e7ed9 h1:k451T+bpsLr+Dq9Ujo+Qtx0iomRA1XXS5ttlEojvfuQ=
 github.com/qydysky/brotli v0.0.0-20240828134800-e9913a6e7ed9/go.mod h1:cI8/gy/wjy2Eb+p2IUj2ZuDnC8R5Vrx3O0VMPvMvphA=
-github.com/qydysky/part v0.28.20250225073648 h1:ENQ88oKNklW2nxreONQDjyO70zCeVy3wuuDMW9GCjBs=
-github.com/qydysky/part v0.28.20250225073648/go.mod h1:MsSAiZMiWQ5pGP5BCEB3OBsoAPaGykNB7vbeY3mKF2w=
+github.com/qydysky/part v0.28.20250225161111 h1:34x3k9NeHpP2rfMaq6d5sm3Lru9QdxI3zcXT5JbgUOg=
+github.com/qydysky/part v0.28.20250225161111/go.mod h1:MsSAiZMiWQ5pGP5BCEB3OBsoAPaGykNB7vbeY3mKF2w=
 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=