From ad7d47a8baf7e5f4e2a4e5925cf3231e39967010 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 17 Jan 2023 11:48:47 +0100 Subject: [PATCH] output/PipeWire: use PW_KEY_TARGET_OBJECT with PipeWire 0.3.64 Closes https://github.com/MusicPlayerDaemon/MPD/issues/1721 --- NEWS | 2 ++ src/output/plugins/PipeWireOutputPlugin.cxx | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 375220511..f940f5988 100644 --- a/NEWS +++ b/NEWS @@ -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) diff --git a/src/output/plugins/PipeWireOutputPlugin.cxx b/src/output/plugins/PipeWireOutputPlugin.cxx index e2c8215eb..aa5b0eb66 100644 --- a/src/output/plugins/PipeWireOutputPlugin.cxx +++ b/src/output/plugins/PipeWireOutputPlugin.cxx @@ -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