synchronize renegotiate to avoid race condition when that fails

This commit is contained in:
Daniel Gultsch 2024-05-06 13:40:10 +02:00
parent 359b2150eb
commit a46246c423
No known key found for this signature in database
GPG key ID: F43D18AD2A0982C2

View file

@ -2482,7 +2482,7 @@ public class JingleRtpConnection extends AbstractJingleConnection
this.webRTCWrapper.execute(this::renegotiate);
}
private void renegotiate() {
private synchronized void renegotiate() {
final SessionDescription sessionDescription;
try {
sessionDescription = setLocalSessionDescription();
@ -2531,11 +2531,12 @@ public class JingleRtpConnection extends AbstractJingleConnection
+ this.webRTCWrapper.getSignalingState());
}
if (diff.added.size() > 0) {
if (diff.added.isEmpty()) {
return;
}
modifyLocalContentMap(rtpContentMap);
sendContentAdd(rtpContentMap, diff.added);
}
}
private void initiateIceRestart(final RtpContentMap rtpContentMap) {
final RtpContentMap transportInfo = rtpContentMap.transportInfo();