From 161bdd9359cfb1131d36cc1596a2a0ad7e481b18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= Date: Sun, 2 Oct 2022 20:03:19 +0200 Subject: ao_pipewire: allow specification of remote name --- audio/out/ao_pipewire.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'audio') diff --git a/audio/out/ao_pipewire.c b/audio/out/ao_pipewire.c index b9144f9921..bfb7eefe24 100644 --- a/audio/out/ao_pipewire.c +++ b/audio/out/ao_pipewire.c @@ -59,6 +59,7 @@ struct priv { struct { int buffer_msec; + char *remote; } options; struct { @@ -405,9 +406,15 @@ static int pipewire_init_boilerplate(struct ao *ao) if (!context) goto error; - p->core = pw_context_connect(context, NULL, 0); - if (!p->core) + p->core = pw_context_connect( + context, + pw_properties_new(PW_KEY_REMOTE_NAME, p->options.remote, NULL), + 0); + if (!p->core) { + MP_WARN(ao, "Could not connect to context '%s': %s\n", + p->options.remote, strerror(errno)); goto error; + } ret = 0; @@ -756,6 +763,7 @@ const struct ao_driver audio_out_pipewire = { .options_prefix = "pipewire", .options = (const struct m_option[]) { {"buffer", OPT_INT(options.buffer_msec), M_RANGE(1, 2000)}, + {"remote", OPT_STRING(options.remote) }, {0} }, }; -- cgit v1.2.3