diff options
author | Wim Taymans <wtaymans@redhat.com> | 2022-07-01 16:55:08 +0200 |
---|---|---|
committer | Philip Langdale <github.philipl@overt.org> | 2022-07-08 07:45:09 -0700 |
commit | 60ed51008d46ddda3310673a6e42023a4abef958 (patch) | |
tree | 61d0973b22ba436e4a72cedce5afc43fe57db9a8 /audio/out | |
parent | d38ff1c958e1ec45cdd569076a61c439d6f77039 (diff) | |
download | mpv-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/out')
-rw-r--r-- | audio/out/ao_pipewire.c | 2 |
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, ®istry_listener, &for_each_sink_registry_events, &revents_ctx); pw_thread_loop_wait(priv->loop); |