Bug 1264344 - Don't restart ICE on first CreateOffer call if iceRestart option is true. r=bwc
authorMichael Froman <mfroman@mozilla.com>
Wed, 13 Apr 2016 11:41:05 -0500
changeset 331215 2377dfe9e73cf6754c3ae1296869a4d31232ef79
parent 331214 3b3d8b016792eff1b67debd4dde55b976926a5fc
child 331216 7ed46b45eef8e576ad9f99def3c24cabfcfe89ab
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbwc
bugs1264344
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1264344 - Don't restart ICE on first CreateOffer call if iceRestart option is true. r=bwc MozReview-Commit-ID: 18qpyjAo0By
media/mtransport/transportlayerice.cpp
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
--- 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() ==