diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-12-11 04:22:03 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-12-11 04:22:03 +0900 |
| commit | e60ff660f69ee4161ee63af3147b5a77d4139e76 (patch) | |
| tree | da0d24eb3782859234e6ec91ff20eef71d0f0722 /internal/pipewire | |
| parent | 47db461546f355b971c3ca35d4dec48778c172ab (diff) | |
internal/pipewire: treat unknown opcode as fatal
Skipping events can cause local state to diverge from the server.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/pipewire')
| -rw-r--r-- | internal/pipewire/client.go | 2 | ||||
| -rw-r--r-- | internal/pipewire/core.go | 4 | ||||
| -rw-r--r-- | internal/pipewire/securitycontext.go | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/internal/pipewire/client.go b/internal/pipewire/client.go index faa114b9..662a24a4 100644 --- a/internal/pipewire/client.go +++ b/internal/pipewire/client.go @@ -113,7 +113,7 @@ func (client *Client) consume(opcode byte, files []int, unmarshal func(v any)) e return nil default: - return &UnsupportedOpcodeError{opcode, client.String()} + panic(&UnsupportedOpcodeError{opcode, client.String()}) } } diff --git a/internal/pipewire/core.go b/internal/pipewire/core.go index d115da33..f6199c44 100644 --- a/internal/pipewire/core.go +++ b/internal/pipewire/core.go @@ -764,7 +764,7 @@ func (core *Core) consume(opcode byte, files []int, unmarshal func(v any)) error return proxy.setBoundProps(&boundProps) default: - return &UnsupportedOpcodeError{opcode, core.String()} + panic(&UnsupportedOpcodeError{opcode, core.String()}) } } @@ -831,7 +831,7 @@ func (registry *Registry) consume(opcode byte, files []int, unmarshal func(v any return nil default: - return &UnsupportedOpcodeError{opcode, registry.String()} + panic(&UnsupportedOpcodeError{opcode, registry.String()}) } } diff --git a/internal/pipewire/securitycontext.go b/internal/pipewire/securitycontext.go index c50665bf..dbc3c529 100644 --- a/internal/pipewire/securitycontext.go +++ b/internal/pipewire/securitycontext.go @@ -190,7 +190,7 @@ func (securityContext *SecurityContext) consume(opcode byte, files []int, _ func // SecurityContext does not receive any events default: - return &UnsupportedOpcodeError{opcode, securityContext.String()} + panic(&UnsupportedOpcodeError{opcode, securityContext.String()}) } } |
