summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorWim Taymans <wtaymans@redhat.com>2022-07-01 16:55:08 +0200
committerPhilip Langdale <github.philipl@overt.org>2022-07-08 07:45:09 -0700
commit60ed51008d46ddda3310673a6e42023a4abef958 (patch)
tree61d0973b22ba436e4a72cedce5afc43fe57db9a8 /audio
parentd38ff1c958e1ec45cdd569076a61c439d6f77039 (diff)
downloadmpv-60ed51008d46ddda3310673a6e42023a4abef958.tar.bz2
mpv-60ed51008d46ddda3310673a6e42023a4abef958.tar.xz
ao_pipewire: zero listeners
The listeners need to be cleared because removing them might invoke the removed handler, which could otherwise point to invalid memory.
Diffstat (limited to 'audio')
-rw-r--r--audio/out/ao_pipewire.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/audio/out/ao_pipewire.c b/audio/out/ao_pipewire.c
index 316c4e58db..7dda0e1068 100644
--- a/audio/out/ao_pipewire.c
+++ b/audio/out/ao_pipewire.c
@@ -307,6 +307,7 @@ static void for_each_sink(struct ao *ao, void (cb) (struct ao *ao, uint32_t id,
pw_thread_loop_lock(priv->loop);
+ spa_zero(core_listener);
pw_core_add_listener(priv->core, &core_listener, &for_each_sink_core_events, priv->loop);
registry = pw_core_get_registry(priv->core, PW_VERSION_REGISTRY, 0);
pw_core_sync(priv->core, 0, 0);
@@ -317,6 +318,7 @@ static void for_each_sink(struct ao *ao, void (cb) (struct ao *ao, uint32_t id,
.sink_cb = cb,
.sink_cb_ctx = cb_ctx,
};
+ spa_zero(registry_listener);
pw_registry_add_listener(registry, &registry_listener, &for_each_sink_registry_events, &revents_ctx);
pw_thread_loop_wait(priv->loop);