From 8f4a3bcf9f3d2dc0d8363b2f66ba41f5bc9f7c6a Mon Sep 17 00:00:00 2001 From: Ophestra Date: Tue, 25 Nov 2025 04:04:07 +0900 Subject: internal/pipewire: use custom marshaler when available This reduces special cases. This change also exposes unmarshalled message size on the wire. Signed-off-by: Ophestra --- internal/pipewire/core.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'internal/pipewire/core.go') diff --git a/internal/pipewire/core.go b/internal/pipewire/core.go index a833009f..9a408e2f 100644 --- a/internal/pipewire/core.go +++ b/internal/pipewire/core.go @@ -76,4 +76,7 @@ type CoreHello struct { func (c *CoreHello) MarshalBinary() ([]byte, error) { return MarshalAppend(make([]byte, 0, 24), c) } // UnmarshalBinary satisfies [encoding.BinaryUnmarshaler] via [Unmarshal]. -func (c *CoreHello) UnmarshalBinary(data []byte) error { return Unmarshal(data, c) } +func (c *CoreHello) UnmarshalBinary(data []byte) error { + _, err := Unmarshal(data, c) + return err +} -- cgit v1.3.1