Bug 1543427 - Part 1: Do not prevent rollback from disassociating a stopped transceiver. r=mjf
authorByron Campen [:bwc] <docfaraday@gmail.com>
Tue, 16 Apr 2019 14:53:03 +0000
changeset 469681 be0d3112f763
parent 469680 b271704f20f7
child 469682 b3cffdee2f6c
push id35879
push usernerli@mozilla.com
push dateTue, 16 Apr 2019 22:01:48 +0000
treeherdermozilla-central@12a60898fdc1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmjf
bugs1543427
milestone68.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 1543427 - Part 1: Do not prevent rollback from disassociating a stopped transceiver. r=mjf Differential Revision: https://phabricator.services.mozilla.com/D26934
media/webrtc/signaling/src/jsep/JsepTransceiver.h
--- a/media/webrtc/signaling/src/jsep/JsepTransceiver.h
+++ b/media/webrtc/signaling/src/jsep/JsepTransceiver.h
@@ -63,20 +63,19 @@ class JsepTransceiver {
                !HasLevel() || oldTransceiver.GetLevel() == GetLevel());
     mTransport = oldTransceiver.mTransport;
     if (rollbackLevel) {
       mLevel = oldTransceiver.mLevel;
       mBundleLevel = oldTransceiver.mBundleLevel;
     }
     mRecvTrack = oldTransceiver.mRecvTrack;
 
-    // stop() caused by a disabled m-section in a remote offer cannot be
-    // rolled back.
-    if (!IsStopped()) {
-      mMid = oldTransceiver.mMid;
+    // Don't allow rollback to re-associate a transceiver.
+    if (!oldTransceiver.IsAssociated()) {
+      Disassociate();
     }
   }
 
   bool IsAssociated() const { return !mMid.empty(); }
 
   const std::string& GetMid() const {
     MOZ_ASSERT(IsAssociated());
     return mMid;
@@ -94,17 +93,20 @@ class JsepTransceiver {
   void SetLevel(size_t level) {
     MOZ_ASSERT(level != SIZE_MAX);
     MOZ_ASSERT(!HasLevel());
     MOZ_ASSERT(!IsStopped());
 
     mLevel = level;
   }
 
-  void ClearLevel() { mLevel = SIZE_MAX; }
+  void ClearLevel() {
+    MOZ_ASSERT(!IsAssociated());
+    mLevel = SIZE_MAX;
+  }
 
   size_t GetLevel() const {
     MOZ_ASSERT(HasLevel());
     return mLevel;
   }
 
   void Stop() { mStopped = true; }