From 99021caf77c4d03412b617bc4d97a7d1daeb0a12 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 9 Feb 2024 14:39:38 -0500 Subject: [PATCH] MT#55283 fix potential deadlock Fix a regression from 4291c858 send_timer_rtcp() does its own locking of the SSRC. Release the lock before calling it. Change-Id: I185fb2fb4b47a343ab4be00d16629b5f330ee965 --- daemon/media_player.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/daemon/media_player.c b/daemon/media_player.c index 52ab9fb4d4..753a37c4da 100644 --- a/daemon/media_player.c +++ b/daemon/media_player.c @@ -297,9 +297,10 @@ static void __send_timer_send_common(struct send_timer *st, struct codec_packet struct ssrc_ctx *ssrc_out = cp->ssrc_out; if (ssrc_out && ssrc_out->next_rtcp.tv_sec) { mutex_lock(&ssrc_out->parent->h.lock); - if (timeval_diff(&ssrc_out->next_rtcp, &rtpe_now) < 0) - send_timer_rtcp(st, ssrc_out); + long long diff = timeval_diff(&ssrc_out->next_rtcp, &rtpe_now); mutex_unlock(&ssrc_out->parent->h.lock); + if (diff < 0) + send_timer_rtcp(st, ssrc_out); } out: