aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/pipewire/pod.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-12-14 09:06:44 +0900
committerOphestra <cat@gensokyo.uk>2025-12-14 09:06:44 +0900
commit00a5bdf006ba800e0797ff4c2b732e5df4fa28ff (patch)
tree1d3c8169e2801f1332ca217a0545a2454efc3498 /internal/pipewire/pod.go
parenta27dfdc058caf4ca0578a7cf98282c1998c94e6b (diff)
internal/pipewire: do not emit None for spa_dict
Turns out the PipeWire server does not expect a value of type None here at all. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/pipewire/pod.go')
-rw-r--r--internal/pipewire/pod.go18
1 files changed, 2 insertions, 16 deletions
diff --git a/internal/pipewire/pod.go b/internal/pipewire/pod.go
index caf83fd0..7cfafc87 100644
--- a/internal/pipewire/pod.go
+++ b/internal/pipewire/pod.go
@@ -524,9 +524,8 @@ type SPADict []SPADictItem
// Size satisfies [KnownSize] with a value computed at runtime.
func (d *SPADict) Size() Word {
- if *d == nil {
- // None type prefix with zero-length body
- return SizePrefix
+ if d == nil {
+ return 0
}
// struct prefix, NItems value
@@ -541,11 +540,6 @@ func (d *SPADict) Size() Word {
// MarshalPOD satisfies [PODMarshaler] as [SPADict] violates the POD type system.
func (d *SPADict) MarshalPOD(data []byte) ([]byte, error) {
return appendInner(data, func(dataPrefix []byte) (data []byte, err error) {
- if *d == nil {
- data = SPA_TYPE_None.append(dataPrefix)
- return
- }
-
data = SPA_TYPE_Struct.append(dataPrefix)
if data, err = MarshalAppend(data, Int(len(*d))); err != nil {
return
@@ -565,14 +559,6 @@ func (d *SPADict) MarshalPOD(data []byte) ([]byte, error) {
// UnmarshalPOD satisfies [PODUnmarshaler] as [SPADict] violates the POD type system.
func (d *SPADict) UnmarshalPOD(data []byte) (Word, error) {
var wireSize Word
-
- if ok, err := unmarshalHandleNone(&data, &wireSize); err != nil {
- return wireSize, err
- } else if ok {
- *d = nil
- return wireSize, nil
- }
-
if err := unmarshalCheckTypeBounds(&data, SPA_TYPE_Struct, &wireSize); err != nil {
return wireSize, err
}