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