Bug 1152093: Perform case-insensitive comparisons for codec types. r=jesup
authorByron Campen [:bwc] <docfaraday@gmail.com>
Thu, 09 Apr 2015 15:40:48 -0700
changeset 240211 a83c90ceb41f0ac166fd81a819be602c9dbe63a3
parent 240210 2dfcc10c727060da6cd8d0c88c45d1b034b94a37
child 240212 5a16a3825802963b523479515d255b38d92786b6
push id58777
push userbcampen@mozilla.com
push dateTue, 21 Apr 2015 16:51:32 +0000
treeherdermozilla-inbound@a83c90ceb41f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs1152093
milestone40.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 1152093: Perform case-insensitive comparisons for codec types. r=jesup
media/webrtc/signaling/src/jsep/JsepCodecDescription.h
--- a/media/webrtc/signaling/src/jsep/JsepCodecDescription.h
+++ b/media/webrtc/signaling/src/jsep/JsepCodecDescription.h
@@ -2,17 +2,19 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef _JSEPCODECDESCRIPTION_H_
 #define _JSEPCODECDESCRIPTION_H_
 
 #include <iostream>
 #include <string>
+#include <string.h>
 #include "signaling/src/sdp/SdpMediaSection.h"
+#include "nsCRT.h"
 
 namespace mozilla {
 
 #define JSEP_CODEC_CLONE(T)                                                    \
   virtual JsepCodecDescription* Clone() const override                         \
   {                                                                            \
     return new T(*this);                                                       \
   }
@@ -72,17 +74,17 @@ struct JsepCodecDescription {
     const SdpRtpmapAttributeList& rtpmap = attrs.GetRtpmap();
     if (!rtpmap.HasEntry(fmt)) {
       return false;
     }
 
     const SdpRtpmapAttributeList::Rtpmap& entry = rtpmap.GetEntry(fmt);
 
     if (mType == remoteMsection.GetMediaType()
-        && (mName == entry.name)
+        && !nsCRT::strcasecmp(mName.c_str(), entry.name.c_str())
         && (mClock == entry.clock)
         && (mChannels == entry.channels)) {
       return ParametersMatch(entry.pt, remoteMsection);
     }
     return false;
   }
 
   virtual bool
@@ -705,17 +707,18 @@ struct JsepApplicationCodecDescription :
 
     const SdpSctpmapAttributeList& sctpmap = attrs.GetSctpmap();
     if (!sctpmap.HasEntry(fmt)) {
       return false;
     }
 
     const SdpSctpmapAttributeList::Sctpmap& entry = sctpmap.GetEntry(fmt);
 
-    if (mType == remoteMsection.GetMediaType() && (mName == entry.name)) {
+    if (mType == remoteMsection.GetMediaType() &&
+        !nsCRT::strcasecmp(mName.c_str(), entry.name.c_str())) {
       return true;
     }
     return false;
   }
 };
 
 } // namespace mozilla