Skip to content

media-session: emit metadata property callbacks safely

P V requested to merge pvir/pipewire:fix-metadata-cb into master

The hook callbacks can (and do) free/overwrite the memory used by the string arguments of metadata.c:impl_set_property.

policy-node runs the pipewire loop in the callback, which cause this. One can e.g. add

pw_log_error(NAME ": metadata_property: key=%s", key);

to the beginning and the end of policy-node.c:metadata_property to see

[E][000012932.642396][policy-node.c:827 metadata_property()] policy-node: metadata_property: key=default.audio.sink
[E][000012932.695229][policy-node.c:852 metadata_property()] policy-node: metadata_property: key=

sometimes occur when policy-node moves playing streams from one sink to another.

Merge request reports