Index: webrtc/modules/audio_coding/codecs/audio_format.cc |
diff --git a/webrtc/modules/audio_coding/codecs/audio_format.cc b/webrtc/modules/audio_coding/codecs/audio_format.cc |
index bb69cbdb2f73be7f36f7983a0a4b7ae662cc03d1..22c8520ca8e1aa4762eeff3e75fba74b17994e56 100644 |
--- a/webrtc/modules/audio_coding/codecs/audio_format.cc |
+++ b/webrtc/modules/audio_coding/codecs/audio_format.cc |
@@ -10,6 +10,8 @@ |
#include "webrtc/modules/audio_coding/codecs/audio_format.h" |
+#include "webrtc/common_types.h" |
+ |
namespace webrtc { |
SdpAudioFormat::SdpAudioFormat() = default; |
@@ -34,6 +36,19 @@ SdpAudioFormat::~SdpAudioFormat() = default; |
SdpAudioFormat& SdpAudioFormat::operator=(const SdpAudioFormat&) = default; |
SdpAudioFormat& SdpAudioFormat::operator=(SdpAudioFormat&&) = default; |
+bool SdpAudioFormat::operator<(const SdpAudioFormat& b) const { |
+ if (clockrate_hz == b.clockrate_hz) { |
+ if (num_channels == b.num_channels) { |
+ int name_cmp = STR_CASE_CMP(name.c_str(), b.name.c_str()); |
ivoc
2016/07/05 14:43:51
Isn't it possible to just do: if (name == b.name)
ossu
2016/07/05 15:31:57
Well, no, we allow any capitalization of format na
ivoc
2016/07/06 15:24:51
Sounds like it would be nice to just convert every
|
+ if (name_cmp == 0) |
+ return parameters < b.parameters; |
+ return name_cmp < 0; |
+ } |
+ return num_channels < b.num_channels; |
+ } |
+ return clockrate_hz < b.clockrate_hz; |
+} |
+ |
void swap(SdpAudioFormat& a, SdpAudioFormat& b) { |
using std::swap; |
swap(a.name, b.name); |