hold back candidates until after content-add

This commit is contained in:
Daniel Gultsch 2023-10-02 13:54:36 +02:00
parent 7e9980d997
commit 17856a47db
No known key found for this signature in database
GPG key ID: F43D18AD2A0982C2
2 changed files with 3 additions and 1 deletions

View file

@ -729,6 +729,7 @@ public class JingleRtpConnection extends AbstractJingleConnection
+ ContentAddition.summary(contentAcceptMap));
modifyLocalContentMap(rtpContentMap);
sendContentAccept(contentAcceptMap);
this.webRTCWrapper.setIsReadyToReceiveIceCandidates(true);
} catch (final Exception e) {
Log.d(Config.LOGTAG, "unable to accept content add", Throwables.getRootCause(e));
webRTCWrapper.close();
@ -862,7 +863,6 @@ public class JingleRtpConnection extends AbstractJingleConnection
webRTCWrapper.setRemoteDescription(sdp).get();
setRemoteContentMap(restartContentMap);
if (isOffer) {
webRTCWrapper.setIsReadyToReceiveIceCandidates(false);
final SessionDescription localSessionDescription = setLocalSessionDescription();
setLocalContentMap(RtpContentMap.of(localSessionDescription, isInitiator()));
// We need to respond OK before sending any candidates
@ -2473,6 +2473,7 @@ public class JingleRtpConnection extends AbstractJingleConnection
handleIqTimeoutResponse(response);
}
});
this.webRTCWrapper.setIsReadyToReceiveIceCandidates(true);
}
private void setLocalContentMap(final RtpContentMap rtpContentMap) {

View file

@ -561,6 +561,7 @@ public class WebRTCWrapper {
}
synchronized ListenableFuture<SessionDescription> setLocalDescription() {
this.setIsReadyToReceiveIceCandidates(false);
return Futures.transformAsync(
getPeerConnectionFuture(),
peerConnection -> {