avoid race condition when restarting ICE
This commit is contained in:
parent
16f140572f
commit
80d195d35e
|
@ -415,12 +415,20 @@ public class WebRTCWrapper {
|
|||
}
|
||||
|
||||
void restartIce() {
|
||||
executorService.execute(() -> {
|
||||
final PeerConnection peerConnection = requirePeerConnection();
|
||||
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();
|
||||
requirePeerConnection().restartIce();}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
public void setIsReadyToReceiveIceCandidates(final boolean ready) {
|
||||
|
|
Loading…
Reference in a new issue