mpv: fix pipewire native client for pipewire-0.3.75_1
This commit is contained in:
parent
c24338f278
commit
4630ea06fb
78
srcpkgs/mpv/patches/pipewire-native.patch
Normal file
78
srcpkgs/mpv/patches/pipewire-native.patch
Normal file
@ -0,0 +1,78 @@
|
||||
From ac6bb48728af60c706a6a92573ea13651adb6d7d Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= <thomas@t-8ch.de>
|
||||
Date: Sun, 23 Jul 2023 09:10:55 +0200
|
||||
Subject: [PATCH] ao_pipewire: for_each_sink: properly check termination
|
||||
condition
|
||||
|
||||
Doing a pw_thread_loop_wait() without checking conditions is invalid.
|
||||
The thread loop could be signalled for other reasons and in this case
|
||||
the wait needs to continue.
|
||||
|
||||
PipeWire added such additional signaling in
|
||||
commit 33be898130f0 ("thread-loop: signal when started").
|
||||
|
||||
This meant that for_each_sink would return before the callbacks have
|
||||
fired and session_has_sink() would incorrectly return "false", failing
|
||||
the initialization of ao_pipewire.
|
||||
|
||||
Fixes #11995
|
||||
---
|
||||
audio/out/ao_pipewire.c | 19 +++++++++++++++----
|
||||
1 file changed, 15 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/audio/out/ao_pipewire.c b/audio/out/ao_pipewire.c
|
||||
index 8e93dc5341b..0a39e4e1a59 100644
|
||||
--- a/audio/out/ao_pipewire.c
|
||||
+++ b/audio/out/ao_pipewire.c
|
||||
@@ -354,6 +354,11 @@ static void for_each_sink_registry_event_global(void *data, uint32_t id,
|
||||
}
|
||||
|
||||
|
||||
+struct for_each_done_ctx {
|
||||
+ struct pw_thread_loop *loop;
|
||||
+ bool done;
|
||||
+};
|
||||
+
|
||||
static const struct pw_registry_events for_each_sink_registry_events = {
|
||||
.version = PW_VERSION_REGISTRY_EVENTS,
|
||||
.global = for_each_sink_registry_event_global,
|
||||
@@ -361,8 +366,9 @@ static const struct pw_registry_events for_each_sink_registry_events = {
|
||||
|
||||
static void for_each_sink_done(void *data, uint32_t it, int seq)
|
||||
{
|
||||
- struct pw_thread_loop *loop = data;
|
||||
- pw_thread_loop_signal(loop, false);
|
||||
+ struct for_each_done_ctx *ctx = data;
|
||||
+ ctx->done = true;
|
||||
+ pw_thread_loop_signal(ctx->loop, false);
|
||||
}
|
||||
|
||||
static const struct pw_core_events for_each_sink_core_events = {
|
||||
@@ -376,12 +382,16 @@ static int for_each_sink(struct ao *ao, void (cb) (struct ao *ao, uint32_t id,
|
||||
struct priv *priv = ao->priv;
|
||||
struct pw_registry *registry;
|
||||
struct spa_hook core_listener;
|
||||
+ struct for_each_done_ctx done_ctx = {
|
||||
+ .loop = priv->loop,
|
||||
+ .done = false,
|
||||
+ };
|
||||
int ret = -1;
|
||||
|
||||
pw_thread_loop_lock(priv->loop);
|
||||
|
||||
spa_zero(core_listener);
|
||||
- if (pw_core_add_listener(priv->core, &core_listener, &for_each_sink_core_events, priv->loop) < 0)
|
||||
+ if (pw_core_add_listener(priv->core, &core_listener, &for_each_sink_core_events, &done_ctx) < 0)
|
||||
goto unlock_loop;
|
||||
|
||||
registry = pw_core_get_registry(priv->core, PW_VERSION_REGISTRY, 0);
|
||||
@@ -400,7 +410,8 @@ static int for_each_sink(struct ao *ao, void (cb) (struct ao *ao, uint32_t id,
|
||||
if (pw_registry_add_listener(registry, ®istry_listener, &for_each_sink_registry_events, &revents_ctx) < 0)
|
||||
goto destroy_registry;
|
||||
|
||||
- pw_thread_loop_wait(priv->loop);
|
||||
+ while (!done_ctx.done)
|
||||
+ pw_thread_loop_wait(priv->loop);
|
||||
|
||||
spa_hook_remove(®istry_listener);
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Template file for 'mpv'
|
||||
pkgname=mpv
|
||||
version=0.35.1
|
||||
revision=2
|
||||
revision=3
|
||||
build_style=meson
|
||||
configure_args="-Dcdda=enabled -Ddvbin=enabled -Ddvdnav=enabled
|
||||
-Dlibmpv=true -Dcplugins=enabled
|
||||
|
Loading…
x
Reference in New Issue
Block a user