Bug 1288105 - Part 2: Fix longstanding bug where rollback could wipe out the codecs in a transceiver, that was being hidden by a bug fixed in part 1. r=mjf
authorByron Campen [:bwc] <docfaraday@gmail.com>
Fri, 05 Apr 2019 17:41:25 +0000
changeset 468371 9fcab041c5d73b9525b22afde2ad658574965992
parent 468370 f06d1670906984bff44e9b1c74ed0d89d519cde8
child 468372 6e4f040f66b7649277ac61bdb16c1b9aebadac97
push id35835
push useraciure@mozilla.com
push dateMon, 08 Apr 2019 19:00:29 +0000
treeherdermozilla-central@40456af7da1c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmjf
bugs1288105
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 1288105 - Part 2: Fix longstanding bug where rollback could wipe out the codecs in a transceiver, that was being hidden by a bug fixed in part 1. r=mjf Depends on D26238 Differential Revision: https://phabricator.services.mozilla.com/D26348
media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
--- a/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
+++ b/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
@@ -1543,16 +1543,18 @@ void JsepSessionImpl::RollbackLocalOffer
     RefPtr<JsepTransceiver>& transceiver(mTransceivers[i]);
     if (i < mOldTransceivers.size()) {
       transceiver->Rollback(*mOldTransceivers[i]);
       continue;
     }
 
     RefPtr<JsepTransceiver> temp(
         new JsepTransceiver(transceiver->GetMediaType()));
+    temp->mSendTrack.PopulateCodecs(mSupportedCodecs);
+    temp->mRecvTrack.PopulateCodecs(mSupportedCodecs);
     transceiver->Rollback(*temp);
   }
 
   mOldTransceivers.clear();
 }
 
 void JsepSessionImpl::RollbackRemoteOffer() {
   for (size_t i = 0; i < mTransceivers.size(); ++i) {
@@ -1565,16 +1567,18 @@ void JsepSessionImpl::RollbackRemoteOffe
     // New transceiver!
     bool shouldRemove = !transceiver->HasAddTrackMagic() &&
                         transceiver->WasCreatedBySetRemote();
 
     // We rollback even for transceivers we will remove, just to ensure we end
     // up at the starting state.
     RefPtr<JsepTransceiver> temp(
         new JsepTransceiver(transceiver->GetMediaType()));
+    temp->mSendTrack.PopulateCodecs(mSupportedCodecs);
+    temp->mRecvTrack.PopulateCodecs(mSupportedCodecs);
     transceiver->Rollback(*temp);
 
     if (shouldRemove) {
       transceiver->Stop();
       transceiver->SetRemoved();
       mTransceivers.erase(mTransceivers.begin() + i);
       --i;
     }