Bug 1363563 - Remove and erase existing header extensions. r=mjf, a=gchang
authorNils Ohlmeier [:drno] <drno@ohlmeier.org>
Wed, 10 May 2017 16:19:40 -0700
changeset 396280 121ef7d3dcaea47b7b7ad0063bae02493ec0584e
parent 396279 6a28c6d2c2f5c48b8ffccd7989dd95a9163fe2e4
child 396281 61f92598393ef97d7548fb8ecf8549877adf93d1
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmjf, gchang
bugs1363563
milestone54.0
Bug 1363563 - Remove and erase existing header extensions. r=mjf, a=gchang MozReview-Commit-ID: IzVEaOhLNwR
media/webrtc/signaling/src/media-conduit/VideoConduit.cpp
--- a/media/webrtc/signaling/src/media-conduit/VideoConduit.cpp
+++ b/media/webrtc/signaling/src/media-conduit/VideoConduit.cpp
@@ -239,19 +239,23 @@ WebrtcVideoConduit::~WebrtcVideoConduit(
 }
 
 void
 WebrtcVideoConduit::AddLocalRTPExtensions(bool aIsSend,
   const std::vector<webrtc::RtpExtension> & aExtensions)
 {
   auto& extList = aIsSend ? mSendStreamConfig.rtp.extensions :
                   mRecvStreamConfig.rtp.extensions;
-  std::remove_if(extList.begin(), extList.end(), [&](const webrtc::RtpExtension & i) {
-    return std::find(aExtensions.begin(), aExtensions.end(),i) != aExtensions.end();
-  });
+  extList.erase(std::remove_if(extList.begin(),
+                               extList.end(),
+                               [&](const webrtc::RtpExtension & i) {
+                                 return std::find(aExtensions.begin(),
+                                                  aExtensions.end(),
+                                                  i) != aExtensions.end(); }),
+                extList.end());
   extList.insert(extList.end(), aExtensions.begin(), aExtensions.end());
 }
 
 std::vector<webrtc::RtpExtension>
 WebrtcVideoConduit::GetLocalRTPExtensions(bool aIsSend) const
 {
   return aIsSend ? mSendStreamConfig.rtp.extensions : mRecvStreamConfig.rtp.extensions;
 }