Bug 1264344 - Don't restart ICE on first CreateOffer call if iceRestart option is true. r=bwc
MozReview-Commit-ID: 18qpyjAo0By
--- a/media/mtransport/transportlayerice.cpp
+++ b/media/mtransport/transportlayerice.cpp
@@ -97,19 +97,17 @@ TransportLayerIce::~TransportLayerIce()
}
void TransportLayerIce::SetParameters(RefPtr<NrIceCtx> ctx,
RefPtr<NrIceMediaStream> stream,
int component) {
// If SetParameters is called and we already have a stream_, this means
// we're handling an ICE restart. We need to hold the old stream until
// we know the new stream is working.
- if (stream_ && !old_stream_) {
- MOZ_ASSERT(stream_ != stream); // make sure we're getting a different stream
-
+ if (stream_ && !old_stream_ && (stream_ != stream)) {
// Here we leave the old stream's signals connected until we don't need
// it anymore. They will be disconnected if ice restart is successful.
old_stream_ = stream_;
MOZ_MTLOG(ML_INFO, LAYER_INFO << "SetParameters save old stream("
<< old_stream_->name() << ")");
}
ctx_ = ctx;
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
@@ -1562,17 +1562,17 @@ PeerConnectionImpl::CreateOffer(const Js
WrapRunnableNM(DeferredCreateOffer, mHandle, aOptions));
STAMP_TIMECARD(mTimeCard, "Deferring CreateOffer (not ready)");
return NS_OK;
}
CSFLogDebug(logTag, "CreateOffer()");
nsresult nrv;
- if (restartIce) {
+ if (restartIce && !mJsepSession->GetLocalDescription().empty()) {
// If restart is requested and a restart is already in progress, we
// need to make room for the restart request so we either rollback
// or finalize to "clear" the previous restart.
if (mMedia->GetIceRestartState() ==
PeerConnectionMedia::ICE_RESTART_PROVISIONAL) {
// we're mid-restart and can rollback
RollbackIceRestart();
} else if (mMedia->GetIceRestartState() ==