From 035a199109efa9d0dc78e8a790bf8bcd34f25969 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 6 Aug 2024 15:17:10 +0300 Subject: [PATCH] rtp: basepay: Don't use suggested SSRC on collissions if it's the current one Part-of: --- net/rtp/src/basepay/imp.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/net/rtp/src/basepay/imp.rs b/net/rtp/src/basepay/imp.rs index 716d6d38..afd15f52 100644 --- a/net/rtp/src/basepay/imp.rs +++ b/net/rtp/src/basepay/imp.rs @@ -1258,7 +1258,11 @@ impl RtpBasePay2 { return; } - let new_ssrc = if let Ok(suggested_ssrc) = s.get::("suggested-ssrc") { + let new_ssrc = if let Some(suggested_ssrc) = s + .get::("suggested-ssrc") + .ok() + .filter(|suggested_ssrc| *suggested_ssrc != stats.ssrc) + { suggested_ssrc } else { use rand::prelude::*;