From a0304c6691da090fcd6cb5182349bdd003ba91fa Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 15 May 2023 12:47:37 +0200 Subject: [PATCH] module-rtp: sync session unlink with data thread See #3217 --- src/modules/module-rtp-session.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/modules/module-rtp-session.c b/src/modules/module-rtp-session.c index 8b26342ad..0df26a89b 100644 --- a/src/modules/module-rtp-session.c +++ b/src/modules/module-rtp-session.c @@ -564,9 +564,21 @@ static const struct rtp_stream_events recv_stream_events = { .send_feedback = recv_send_feedback, }; +static int +do_unlink_session(struct spa_loop *loop, + bool async, uint32_t seq, const void *data, size_t size, void *user_data) +{ + struct session *sess = user_data; + spa_list_remove(&sess->link); + return 0; +} + static void free_session(struct session *sess) { - spa_list_remove(&sess->link); + struct impl *impl = sess->impl; + + pw_loop_invoke(impl->data_loop, do_unlink_session, 1, NULL, 0, true, sess); + sess->impl->n_sessions--; if (sess->send)