diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-12-02 06:03:21 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-12-02 06:03:21 +0900 |
| commit | af741f20a003d48863eb5e9f7cf71052abd4116d (patch) | |
| tree | 0ec7e558e0fdfae6a772d37c3c87c721ca882e6b /internal/pipewire/header.go | |
| parent | 39c6716fb0081249908433403c4da6298a4d12d3 (diff) | |
internal/pipewire: implement client context
This consumes the entire sample, is validated to send identical messages and correctly handle received messages.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/pipewire/header.go')
| -rw-r--r-- | internal/pipewire/header.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/pipewire/header.go b/internal/pipewire/header.go index 40ea0805..3aecfb7d 100644 --- a/internal/pipewire/header.go +++ b/internal/pipewire/header.go @@ -31,7 +31,7 @@ type Header struct { // An increasing sequence number for each message. Sequence Int `json:"seq"` // Number of file descriptors in this message. - FileCount Word `json:"n_fds"` + FileCount Int `json:"n_fds"` } // append appends the protocol native message header to data. @@ -41,7 +41,7 @@ func (h *Header) append(data []byte) []byte { data = binary.NativeEndian.AppendUint32(data, Word(h.ID)) data = binary.NativeEndian.AppendUint32(data, Word(h.Opcode)<<24|h.Size) data = binary.NativeEndian.AppendUint32(data, Word(h.Sequence)) - data = binary.NativeEndian.AppendUint32(data, h.FileCount) + data = binary.NativeEndian.AppendUint32(data, Word(h.FileCount)) return data } @@ -60,7 +60,7 @@ func (h *Header) unmarshalBinary(data [SizeHeader]byte) { h.Opcode = byte(h.Size >> 24) h.Size &= SizeMax h.Sequence = Int(binary.NativeEndian.Uint32(data[8:])) - h.FileCount = binary.NativeEndian.Uint32(data[12:]) + h.FileCount = Int(binary.NativeEndian.Uint32(data[12:])) } // UnmarshalBinary decodes the protocol native message header. |
