Bug 1152093 - Perform case-insensitive comparisons for codec types. r=jesup, a=sledru
authorByron Campen [:bwc] <docfaraday@gmail.com>
Thu, 09 Apr 2015 15:40:48 -0700
changeset 267255 5c890ed2dc6c5080c5e895969759aa434784cf7a
parent 267254 9242257d7697067836b210ffece24addd5d36cad
child 267256 5aa451309199c8f5155266fd60e9554c303e3629
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup, sledru
bugs1152093
milestone39.0a2
Bug 1152093 - Perform case-insensitive comparisons for codec types. r=jesup, a=sledru
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);                                                       \
   }
@@ -71,17 +73,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
@@ -712,17 +714,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