output/PipeWire: use PW_KEY_TARGET_OBJECT with PipeWire 0.3.64

Closes https://github.com/MusicPlayerDaemon/MPD/issues/1721
This commit is contained in:
Max Kellermann 2023-01-17 11:48:47 +01:00
parent 0948c607b6
commit ad7d47a8ba
2 changed files with 9 additions and 1 deletions

2
NEWS
View File

@ -3,6 +3,8 @@ ver 0.23.12 (not yet released)
- curl: require CURL 7.55.0 or later
* tags
- fix crash bug due to race condition
* output
- pipewire: adjust to PipeWire 0.3.64 API change
* fix build failures with GCC 13
ver 0.23.11 (2022/11/28)

View File

@ -523,7 +523,13 @@ PipeWireOutput::Open(AudioFormat &audio_format)
pw_properties_setf(props, PW_KEY_REMOTE_NAME, "%s", remote);
if (target != nullptr && target_id == PW_ID_ANY)
pw_properties_setf(props, PW_KEY_NODE_TARGET, "%s", target);
pw_properties_setf(props,
#if PW_CHECK_VERSION(0, 3, 64)
PW_KEY_TARGET_OBJECT,
#else
PW_KEY_NODE_TARGET,
#endif
"%s", target);
#ifdef PW_KEY_NODE_RATE
/* ask PipeWire to change the graph sample rate to ours