chore: bump dependencies and soften shutdown audio warning
- commit
- 338556184ea823dfbcb99189c0074744d95b8932
- author
- brice · · 2026-05-15 13:21 UTC
- parent
- 27cbd02
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
4 files · +107 -61
M go.mod +18 -15
| @@ -8,7 +8,7 @@ require ( | |||
| 8 | 8 | github.com/bnema/purego v0.11.0-bnema.2 | |
| 9 | 9 | github.com/bnema/purego-cef v0.13.0 | |
| 10 | 10 | github.com/bnema/purego-cef2gtk v0.1.1 | |
| 11 | - | github.com/bnema/purego-pipewire v0.1.2 | |
| 11 | + | github.com/bnema/purego-pipewire v0.1.3 | |
| 12 | 12 | github.com/bnema/purego-sqlite v0.1.2 | |
| 13 | 13 | github.com/bnema/puregotk v0.5.2 | |
| 14 | 14 | github.com/charmbracelet/bubbles v1.0.0 | |
| @@ -32,25 +32,25 @@ require ( | |||
| 32 | 32 | github.com/atotto/clipboard v0.1.4 // indirect | |
| 33 | 33 | github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect | |
| 34 | 34 | github.com/cenkalti/backoff/v4 v4.3.0 // indirect | |
| 35 | - | github.com/charmbracelet/colorprofile v0.4.1 // indirect | |
| 36 | - | github.com/charmbracelet/x/ansi v0.11.6 // indirect | |
| 35 | + | github.com/charmbracelet/colorprofile v0.4.3 // indirect | |
| 36 | + | github.com/charmbracelet/x/ansi v0.11.7 // indirect | |
| 37 | 37 | github.com/charmbracelet/x/cellbuf v0.0.15 // indirect | |
| 38 | + | github.com/charmbracelet/x/exp/golden v0.0.0-20260511125431-fe5d686e0c99 // indirect | |
| 38 | 39 | github.com/charmbracelet/x/term v0.2.2 // indirect | |
| 39 | 40 | github.com/cli/browser v1.3.0 // indirect | |
| 40 | - | github.com/clipperhouse/displaywidth v0.9.0 // indirect | |
| 41 | - | github.com/clipperhouse/stringish v0.1.1 // indirect | |
| 42 | - | github.com/clipperhouse/uax29/v2 v2.5.0 // indirect | |
| 41 | + | github.com/clipperhouse/displaywidth v0.11.0 // indirect | |
| 42 | + | github.com/clipperhouse/uax29/v2 v2.7.0 // indirect | |
| 43 | 43 | github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect | |
| 44 | 44 | github.com/davecgh/go-spew v1.1.1 // indirect | |
| 45 | 45 | github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect | |
| 46 | - | github.com/fatih/color v1.16.0 // indirect | |
| 46 | + | github.com/fatih/color v1.19.0 // indirect | |
| 47 | 47 | github.com/go-viper/mapstructure/v2 v2.5.0 // indirect | |
| 48 | 48 | github.com/inconshreveable/mousetrap v1.1.0 // indirect | |
| 49 | - | github.com/lucasb-eyer/go-colorful v1.3.0 // indirect | |
| 49 | + | github.com/lucasb-eyer/go-colorful v1.4.0 // indirect | |
| 50 | 50 | github.com/mattn/go-colorable v0.1.14 // indirect | |
| 51 | - | github.com/mattn/go-isatty v0.0.21 // indirect | |
| 51 | + | github.com/mattn/go-isatty v0.0.22 // indirect | |
| 52 | 52 | github.com/mattn/go-localereader v0.0.1 // indirect | |
| 53 | - | github.com/mattn/go-runewidth v0.0.19 // indirect | |
| 53 | + | github.com/mattn/go-runewidth v0.0.23 // indirect | |
| 54 | 54 | github.com/mfridman/interpolate v0.0.2 // indirect | |
| 55 | 55 | github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect | |
| 56 | 56 | github.com/muesli/cancelreader v0.2.2 // indirect | |
| @@ -61,7 +61,7 @@ require ( | |||
| 61 | 61 | github.com/rogpeppe/go-internal v1.14.1 // indirect | |
| 62 | 62 | github.com/russross/blackfriday/v2 v2.1.0 // indirect | |
| 63 | 63 | github.com/sagikazarmark/locafero v0.12.0 // indirect | |
| 64 | - | github.com/sahilm/fuzzy v0.1.1 // indirect | |
| 64 | + | github.com/sahilm/fuzzy v0.1.2 // indirect | |
| 65 | 65 | github.com/sethvargo/go-retry v0.3.0 // indirect | |
| 66 | 66 | github.com/spf13/afero v1.15.0 // indirect | |
| 67 | 67 | github.com/spf13/cast v1.10.0 // indirect | |
| @@ -69,14 +69,17 @@ require ( | |||
| 69 | 69 | github.com/stretchr/objx v0.5.3 // indirect | |
| 70 | 70 | github.com/subosito/gotenv v1.6.0 // indirect | |
| 71 | 71 | github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect | |
| 72 | + | github.com/xyproto/randomstring v1.2.0 // indirect | |
| 72 | 73 | go.uber.org/multierr v1.11.0 // indirect | |
| 73 | 74 | go.yaml.in/yaml/v3 v3.0.4 // indirect | |
| 74 | - | golang.org/x/mod v0.35.0 // indirect | |
| 75 | - | golang.org/x/net v0.53.0 // indirect | |
| 75 | + | golang.org/x/exp v0.0.0-20260508232706-74f9aab9d74a // indirect | |
| 76 | + | golang.org/x/mod v0.36.0 // indirect | |
| 77 | + | golang.org/x/net v0.54.0 // indirect | |
| 76 | 78 | golang.org/x/sync v0.20.0 // indirect | |
| 77 | 79 | golang.org/x/text v0.37.0 // indirect | |
| 78 | - | golang.org/x/tools v0.44.0 // indirect | |
| 79 | - | gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect | |
| 80 | + | golang.org/x/tools v0.45.0 // indirect | |
| 81 | + | gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect | |
| 82 | + | modernc.org/sqlite v1.50.1 // indirect | |
| 80 | 83 | ) | |
| 81 | 84 | ||
| 82 | 85 | tool github.com/a-h/templ/cmd/templ | |
| @@ -8,7 +8,7 @@ require ( | |||||
| 8 | github.com/bnema/purego v0.11.0-bnema.2 | 8 | github.com/bnema/purego v0.11.0-bnema.2 | ||
| 9 | github.com/bnema/purego-cef v0.13.0 | 9 | github.com/bnema/purego-cef v0.13.0 | ||
| 10 | github.com/bnema/purego-cef2gtk v0.1.1 | 10 | github.com/bnema/purego-cef2gtk v0.1.1 | ||
| 11 | - | github.com/bnema/purego-pipewire v0.1.2 | 11 | + | github.com/bnema/purego-pipewire v0.1.3 |
| 12 | github.com/bnema/purego-sqlite v0.1.2 | 12 | github.com/bnema/purego-sqlite v0.1.2 | ||
| 13 | github.com/bnema/puregotk v0.5.2 | 13 | github.com/bnema/puregotk v0.5.2 | ||
| 14 | github.com/charmbracelet/bubbles v1.0.0 | 14 | github.com/charmbracelet/bubbles v1.0.0 | ||
| @@ -32,25 +32,25 @@ require ( | |||||
| 32 | github.com/atotto/clipboard v0.1.4 // indirect | 32 | github.com/atotto/clipboard v0.1.4 // indirect | ||
| 33 | github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect | 33 | github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect | ||
| 34 | github.com/cenkalti/backoff/v4 v4.3.0 // indirect | 34 | github.com/cenkalti/backoff/v4 v4.3.0 // indirect | ||
| 35 | - | github.com/charmbracelet/colorprofile v0.4.1 // indirect | 35 | + | github.com/charmbracelet/colorprofile v0.4.3 // indirect |
| 36 | - | github.com/charmbracelet/x/ansi v0.11.6 // indirect | 36 | + | github.com/charmbracelet/x/ansi v0.11.7 // indirect |
| 37 | github.com/charmbracelet/x/cellbuf v0.0.15 // indirect | 37 | github.com/charmbracelet/x/cellbuf v0.0.15 // indirect | ||
| 38 | + | github.com/charmbracelet/x/exp/golden v0.0.0-20260511125431-fe5d686e0c99 // indirect | |||
| 38 | github.com/charmbracelet/x/term v0.2.2 // indirect | 39 | github.com/charmbracelet/x/term v0.2.2 // indirect | ||
| 39 | github.com/cli/browser v1.3.0 // indirect | 40 | github.com/cli/browser v1.3.0 // indirect | ||
| 40 | - | github.com/clipperhouse/displaywidth v0.9.0 // indirect | 41 | + | github.com/clipperhouse/displaywidth v0.11.0 // indirect |
| 41 | - | github.com/clipperhouse/stringish v0.1.1 // indirect | 42 | + | github.com/clipperhouse/uax29/v2 v2.7.0 // indirect |
| 42 | - | github.com/clipperhouse/uax29/v2 v2.5.0 // indirect | |||
| 43 | github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect | 43 | github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect | ||
| 44 | github.com/davecgh/go-spew v1.1.1 // indirect | 44 | github.com/davecgh/go-spew v1.1.1 // indirect | ||
| 45 | github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect | 45 | github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect | ||
| 46 | - | github.com/fatih/color v1.16.0 // indirect | 46 | + | github.com/fatih/color v1.19.0 // indirect |
| 47 | github.com/go-viper/mapstructure/v2 v2.5.0 // indirect | 47 | github.com/go-viper/mapstructure/v2 v2.5.0 // indirect | ||
| 48 | github.com/inconshreveable/mousetrap v1.1.0 // indirect | 48 | github.com/inconshreveable/mousetrap v1.1.0 // indirect | ||
| 49 | - | github.com/lucasb-eyer/go-colorful v1.3.0 // indirect | 49 | + | github.com/lucasb-eyer/go-colorful v1.4.0 // indirect |
| 50 | github.com/mattn/go-colorable v0.1.14 // indirect | 50 | github.com/mattn/go-colorable v0.1.14 // indirect | ||
| 51 | - | github.com/mattn/go-isatty v0.0.21 // indirect | 51 | + | github.com/mattn/go-isatty v0.0.22 // indirect |
| 52 | github.com/mattn/go-localereader v0.0.1 // indirect | 52 | github.com/mattn/go-localereader v0.0.1 // indirect | ||
| 53 | - | github.com/mattn/go-runewidth v0.0.19 // indirect | 53 | + | github.com/mattn/go-runewidth v0.0.23 // indirect |
| 54 | github.com/mfridman/interpolate v0.0.2 // indirect | 54 | github.com/mfridman/interpolate v0.0.2 // indirect | ||
| 55 | github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect | 55 | github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect | ||
| 56 | github.com/muesli/cancelreader v0.2.2 // indirect | 56 | github.com/muesli/cancelreader v0.2.2 // indirect | ||
| @@ -61,7 +61,7 @@ require ( | |||||
| 61 | github.com/rogpeppe/go-internal v1.14.1 // indirect | 61 | github.com/rogpeppe/go-internal v1.14.1 // indirect | ||
| 62 | github.com/russross/blackfriday/v2 v2.1.0 // indirect | 62 | github.com/russross/blackfriday/v2 v2.1.0 // indirect | ||
| 63 | github.com/sagikazarmark/locafero v0.12.0 // indirect | 63 | github.com/sagikazarmark/locafero v0.12.0 // indirect | ||
| 64 | - | github.com/sahilm/fuzzy v0.1.1 // indirect | 64 | + | github.com/sahilm/fuzzy v0.1.2 // indirect |
| 65 | github.com/sethvargo/go-retry v0.3.0 // indirect | 65 | github.com/sethvargo/go-retry v0.3.0 // indirect | ||
| 66 | github.com/spf13/afero v1.15.0 // indirect | 66 | github.com/spf13/afero v1.15.0 // indirect | ||
| 67 | github.com/spf13/cast v1.10.0 // indirect | 67 | github.com/spf13/cast v1.10.0 // indirect | ||
| @@ -69,14 +69,17 @@ require ( | |||||
| 69 | github.com/stretchr/objx v0.5.3 // indirect | 69 | github.com/stretchr/objx v0.5.3 // indirect | ||
| 70 | github.com/subosito/gotenv v1.6.0 // indirect | 70 | github.com/subosito/gotenv v1.6.0 // indirect | ||
| 71 | github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect | 71 | github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect | ||
| 72 | + | github.com/xyproto/randomstring v1.2.0 // indirect | |||
| 72 | go.uber.org/multierr v1.11.0 // indirect | 73 | go.uber.org/multierr v1.11.0 // indirect | ||
| 73 | go.yaml.in/yaml/v3 v3.0.4 // indirect | 74 | go.yaml.in/yaml/v3 v3.0.4 // indirect | ||
| 74 | - | golang.org/x/mod v0.35.0 // indirect | 75 | + | golang.org/x/exp v0.0.0-20260508232706-74f9aab9d74a // indirect |
| 75 | - | golang.org/x/net v0.53.0 // indirect | 76 | + | golang.org/x/mod v0.36.0 // indirect |
| 77 | + | golang.org/x/net v0.54.0 // indirect | |||
| 76 | golang.org/x/sync v0.20.0 // indirect | 78 | golang.org/x/sync v0.20.0 // indirect | ||
| 77 | golang.org/x/text v0.37.0 // indirect | 79 | golang.org/x/text v0.37.0 // indirect | ||
| 78 | - | golang.org/x/tools v0.44.0 // indirect | 80 | + | golang.org/x/tools v0.45.0 // indirect |
| 79 | - | gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect | 81 | + | gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect |
| 82 | + | modernc.org/sqlite v1.50.1 // indirect | |||
| 80 | ) | 83 | ) | ||
| 81 | 84 | ||||
| 82 | tool github.com/a-h/templ/cmd/templ | 85 | tool github.com/a-h/templ/cmd/templ | ||
M go.sum +43 -44 generated file: collapsed
M internal/infrastructure/cef/webview_audio_test.go +38 -0
| @@ -1,14 +1,18 @@ | |||
| 1 | 1 | package cef | |
| 2 | 2 | ||
| 3 | 3 | import ( | |
| 4 | + | "bytes" | |
| 4 | 5 | "context" | |
| 5 | 6 | "errors" | |
| 7 | + | "strings" | |
| 6 | 8 | "testing" | |
| 7 | 9 | "time" | |
| 8 | 10 | ||
| 9 | 11 | "github.com/bnema/dumber/internal/application/port" | |
| 10 | 12 | "github.com/bnema/dumber/internal/infrastructure/audio/null" | |
| 13 | + | "github.com/bnema/dumber/internal/logging" | |
| 11 | 14 | purecef "github.com/bnema/purego-cef/cef" | |
| 15 | + | "github.com/rs/zerolog" | |
| 12 | 16 | "github.com/stretchr/testify/assert" | |
| 13 | 17 | "github.com/stretchr/testify/require" | |
| 14 | 18 | ) | |
| @@ -416,6 +420,40 @@ func TestHandlerSet_OnAudioStreamError_NoActiveStream_DoesNotPanic(t *testing.T) | |||
| 416 | 420 | assert.False(t, wv.audioPlaying.Load()) | |
| 417 | 421 | } | |
| 418 | 422 | ||
| 423 | + | func TestHandlerSet_OnAudioStreamError_LogsWarnForNormalError(t *testing.T) { | |
| 424 | + | var logs bytes.Buffer | |
| 425 | + | logger := zerolog.New(&logs).Level(zerolog.DebugLevel) | |
| 426 | + | ctx := logging.WithContext(context.Background(), logger) | |
| 427 | + | ||
| 428 | + | wv := &WebView{ctx: ctx} | |
| 429 | + | handlers := &handlerSet{wv: wv} | |
| 430 | + | ||
| 431 | + | handlers.OnAudioStreamError(nil, "test error") | |
| 432 | + | ||
| 433 | + | output := logs.String() | |
| 434 | + | assert.Contains(t, output, `"level":"warn"`) | |
| 435 | + | assert.Contains(t, output, `"message":"cef: audio stream error"`) | |
| 436 | + | assert.Contains(t, output, `"error":"test error"`) | |
| 437 | + | } | |
| 438 | + | ||
| 439 | + | func TestHandlerSet_OnAudioStreamError_ShutdownSocketCloseLogsDebug(t *testing.T) { | |
| 440 | + | var logs bytes.Buffer | |
| 441 | + | logger := zerolog.New(&logs).Level(zerolog.DebugLevel) | |
| 442 | + | ctx := logging.WithContext(context.Background(), logger) | |
| 443 | + | ||
| 444 | + | wv := &WebView{ctx: ctx} | |
| 445 | + | wv.destroyed.Store(true) | |
| 446 | + | handlers := &handlerSet{wv: wv} | |
| 447 | + | ||
| 448 | + | handlers.OnAudioStreamError(nil, "Socket closed unexpectedly") | |
| 449 | + | ||
| 450 | + | output := logs.String() | |
| 451 | + | assert.Contains(t, output, `"level":"debug"`) | |
| 452 | + | assert.NotContains(t, output, `"level":"warn"`) | |
| 453 | + | assert.Contains(t, output, `"message":"cef: audio stream closed during shutdown"`) | |
| 454 | + | assert.True(t, strings.Contains(output, `"error":"Socket closed unexpectedly"`)) | |
| 455 | + | } | |
| 456 | + | ||
| 419 | 457 | // TestWebView_Destroy_ClosesAudioStream verifies that destroying | |
| 420 | 458 | // the WebView closes any active audio stream. | |
| 421 | 459 | func TestWebView_Destroy_ClosesAudioStream(t *testing.T) { | |
| @@ -1,14 +1,18 @@ | |||||
| 1 | package cef | 1 | package cef | ||
| 2 | 2 | ||||
| 3 | import ( | 3 | import ( | ||
| 4 | + | "bytes" | |||
| 4 | "context" | 5 | "context" | ||
| 5 | "errors" | 6 | "errors" | ||
| 7 | + | "strings" | |||
| 6 | "testing" | 8 | "testing" | ||
| 7 | "time" | 9 | "time" | ||
| 8 | 10 | ||||
| 9 | "github.com/bnema/dumber/internal/application/port" | 11 | "github.com/bnema/dumber/internal/application/port" | ||
| 10 | "github.com/bnema/dumber/internal/infrastructure/audio/null" | 12 | "github.com/bnema/dumber/internal/infrastructure/audio/null" | ||
| 13 | + | "github.com/bnema/dumber/internal/logging" | |||
| 11 | purecef "github.com/bnema/purego-cef/cef" | 14 | purecef "github.com/bnema/purego-cef/cef" | ||
| 15 | + | "github.com/rs/zerolog" | |||
| 12 | "github.com/stretchr/testify/assert" | 16 | "github.com/stretchr/testify/assert" | ||
| 13 | "github.com/stretchr/testify/require" | 17 | "github.com/stretchr/testify/require" | ||
| 14 | ) | 18 | ) | ||
| @@ -416,6 +420,40 @@ func TestHandlerSet_OnAudioStreamError_NoActiveStream_DoesNotPanic(t *testing.T) | |||||
| 416 | assert.False(t, wv.audioPlaying.Load()) | 420 | assert.False(t, wv.audioPlaying.Load()) | ||
| 417 | } | 421 | } | ||
| 418 | 422 | ||||
| 423 | + | func TestHandlerSet_OnAudioStreamError_LogsWarnForNormalError(t *testing.T) { | |||
| 424 | + | var logs bytes.Buffer | |||
| 425 | + | logger := zerolog.New(&logs).Level(zerolog.DebugLevel) | |||
| 426 | + | ctx := logging.WithContext(context.Background(), logger) | |||
| 427 | + | ||||
| 428 | + | wv := &WebView{ctx: ctx} | |||
| 429 | + | handlers := &handlerSet{wv: wv} | |||
| 430 | + | ||||
| 431 | + | handlers.OnAudioStreamError(nil, "test error") | |||
| 432 | + | ||||
| 433 | + | output := logs.String() | |||
| 434 | + | assert.Contains(t, output, `"level":"warn"`) | |||
| 435 | + | assert.Contains(t, output, `"message":"cef: audio stream error"`) | |||
| 436 | + | assert.Contains(t, output, `"error":"test error"`) | |||
| 437 | + | } | |||
| 438 | + | ||||
| 439 | + | func TestHandlerSet_OnAudioStreamError_ShutdownSocketCloseLogsDebug(t *testing.T) { | |||
| 440 | + | var logs bytes.Buffer | |||
| 441 | + | logger := zerolog.New(&logs).Level(zerolog.DebugLevel) | |||
| 442 | + | ctx := logging.WithContext(context.Background(), logger) | |||
| 443 | + | ||||
| 444 | + | wv := &WebView{ctx: ctx} | |||
| 445 | + | wv.destroyed.Store(true) | |||
| 446 | + | handlers := &handlerSet{wv: wv} | |||
| 447 | + | ||||
| 448 | + | handlers.OnAudioStreamError(nil, "Socket closed unexpectedly") | |||
| 449 | + | ||||
| 450 | + | output := logs.String() | |||
| 451 | + | assert.Contains(t, output, `"level":"debug"`) | |||
| 452 | + | assert.NotContains(t, output, `"level":"warn"`) | |||
| 453 | + | assert.Contains(t, output, `"message":"cef: audio stream closed during shutdown"`) | |||
| 454 | + | assert.True(t, strings.Contains(output, `"error":"Socket closed unexpectedly"`)) | |||
| 455 | + | } | |||
| 456 | + | ||||
| 419 | // TestWebView_Destroy_ClosesAudioStream verifies that destroying | 457 | // TestWebView_Destroy_ClosesAudioStream verifies that destroying | ||
| 420 | // the WebView closes any active audio stream. | 458 | // the WebView closes any active audio stream. | ||
| 421 | func TestWebView_Destroy_ClosesAudioStream(t *testing.T) { | 459 | func TestWebView_Destroy_ClosesAudioStream(t *testing.T) { | ||
M internal/infrastructure/cef/webview_handlers.go +8 -2
| @@ -1080,11 +1080,17 @@ func (h *handlerSet) OnAudioStreamStopped(_ purecef.Browser) { | |||
| 1080 | 1080 | // OnAudioStreamError handles stream errors. | |
| 1081 | 1081 | func (h *handlerSet) OnAudioStreamError(_ purecef.Browser, message string) { | |
| 1082 | 1082 | if h.wv.ctx != nil { | |
| 1083 | - | logging.FromContext(h.wv.ctx).Warn(). | |
| 1083 | + | event := logging.FromContext(h.wv.ctx).Warn() | |
| 1084 | + | logMsg := "cef: audio stream error" | |
| 1085 | + | if h.wv.destroyed.Load() && message == "Socket closed unexpectedly" { | |
| 1086 | + | event = logging.FromContext(h.wv.ctx).Debug() | |
| 1087 | + | logMsg = "cef: audio stream closed during shutdown" | |
| 1088 | + | } | |
| 1089 | + | event. | |
| 1084 | 1090 | Str("error", message). | |
| 1085 | 1091 | Uint64("packets_received", h.wv.audioPacketCount.Load()). | |
| 1086 | 1092 | Uint64("writes_succeeded", h.wv.audioWriteCount.Load()). | |
| 1087 | - | Msg("cef: audio stream error") | |
| 1093 | + | Msg(logMsg) | |
| 1088 | 1094 | } | |
| 1089 | 1095 | h.wv.setAudioPlaying(false) | |
| 1090 | 1096 | h.wv.closeAudioStream() | |
| @@ -1080,11 +1080,17 @@ func (h *handlerSet) OnAudioStreamStopped(_ purecef.Browser) { | |||||
| 1080 | // OnAudioStreamError handles stream errors. | 1080 | // OnAudioStreamError handles stream errors. | ||
| 1081 | func (h *handlerSet) OnAudioStreamError(_ purecef.Browser, message string) { | 1081 | func (h *handlerSet) OnAudioStreamError(_ purecef.Browser, message string) { | ||
| 1082 | if h.wv.ctx != nil { | 1082 | if h.wv.ctx != nil { | ||
| 1083 | - | logging.FromContext(h.wv.ctx).Warn(). | 1083 | + | event := logging.FromContext(h.wv.ctx).Warn() |
| 1084 | + | logMsg := "cef: audio stream error" | |||
| 1085 | + | if h.wv.destroyed.Load() && message == "Socket closed unexpectedly" { | |||
| 1086 | + | event = logging.FromContext(h.wv.ctx).Debug() | |||
| 1087 | + | logMsg = "cef: audio stream closed during shutdown" | |||
| 1088 | + | } | |||
| 1089 | + | event. | |||
| 1084 | Str("error", message). | 1090 | Str("error", message). | ||
| 1085 | Uint64("packets_received", h.wv.audioPacketCount.Load()). | 1091 | Uint64("packets_received", h.wv.audioPacketCount.Load()). | ||
| 1086 | Uint64("writes_succeeded", h.wv.audioWriteCount.Load()). | 1092 | Uint64("writes_succeeded", h.wv.audioWriteCount.Load()). | ||
| 1087 | - | Msg("cef: audio stream error") | 1093 | + | Msg(logMsg) |
| 1088 | } | 1094 | } | ||
| 1089 | h.wv.setAudioPlaying(false) | 1095 | h.wv.setAudioPlaying(false) | ||
| 1090 | h.wv.closeAudioStream() | 1096 | h.wv.closeAudioStream() | ||