forked from mirror/monocles_chat
avoid race condition when restarting ICE
(cherry picked from commit 80d195d35eba1d1b12f9efbb86734c33d234ad61)
This commit is contained in:
parent
f9126c87d4
commit
5ac7c9ca2c
1 changed files with 14 additions and 6 deletions
|
@ -423,12 +423,20 @@ public class WebRTCWrapper {
|
|||
}
|
||||
|
||||
void restartIce() {
|
||||
executorService.execute(() -> {
|
||||
final PeerConnection peerConnection = requirePeerConnection();
|
||||
setIsReadyToReceiveIceCandidates(false);
|
||||
peerConnection.restartIce();
|
||||
requirePeerConnection().restartIce();}
|
||||
);
|
||||
executorService.execute(
|
||||
() -> {
|
||||
final PeerConnection peerConnection;
|
||||
try {
|
||||
peerConnection = requirePeerConnection();
|
||||
} catch (final PeerConnectionNotInitialized e) {
|
||||
Log.w(
|
||||
EXTENDED_LOGGING_TAG,
|
||||
"PeerConnection vanished before we could execute restart");
|
||||
return;
|
||||
}
|
||||
setIsReadyToReceiveIceCandidates(false);
|
||||
peerConnection.restartIce();
|
||||
});
|
||||
}
|
||||
|
||||
public void setIsReadyToReceiveIceCandidates(final boolean ready) {
|
||||
|
|
Loading…
Add table
Reference in a new issue