Chromium Code Reviews| Index: webrtc/api/webrtcsdp.cc |
| diff --git a/webrtc/api/webrtcsdp.cc b/webrtc/api/webrtcsdp.cc |
| index 4df4ef8566f355c7730962543fceac55ba8d7fab..d44d21cd9087cade382a7d4b284247e24f4ac17c 100644 |
| --- a/webrtc/api/webrtcsdp.cc |
| +++ b/webrtc/api/webrtcsdp.cc |
| @@ -1260,8 +1260,8 @@ void BuildMediaDescription(const ContentInfo* content_info, |
| for (std::vector<cricket::DataCodec>::const_iterator it = |
| data_desc->codecs().begin(); |
| it != data_desc->codecs().end(); ++it) { |
| - if (it->id == cricket::kGoogleSctpDataCodecId && |
| - it->GetParam(cricket::kCodecParamPort, &sctp_port)) { |
| + if (_stricmp(it->name.c_str(), cricket::kGoogleSctpDataCodecName) == 0 |
|
Taylor Brandstetter
2016/10/07 17:35:53
nit: Use CodecNamesEq here and elsewhere
|
| + && it->GetParam(cricket::kCodecParamPort, &sctp_port)) { |
| break; |
| } |
| } |
| @@ -1651,13 +1651,15 @@ void AddRtcpFbLines(const T& codec, std::string* message) { |
| bool AddSctpDataCodec(DataContentDescription* media_desc, |
| int sctp_port) { |
| - if (media_desc->HasCodec(cricket::kGoogleSctpDataCodecId)) { |
| - return ParseFailed("", |
| - "Can't have multiple sctp port attributes.", |
| - NULL); |
| + for (const auto& codec : media_desc->codecs()) { |
| + if (_stricmp(codec.name.c_str(), cricket::kGoogleSctpDataCodecName) == 0) { |
| + return ParseFailed("", |
| + "Can't have multiple sctp port attributes.", |
| + NULL); |
| + } |
| } |
| // Add the SCTP Port number as a pseudo-codec "port" parameter |
| - cricket::DataCodec codec_port(cricket::kGoogleSctpDataCodecId, |
| + cricket::DataCodec codec_port(cricket::kGoogleSctpDataCodecPlType, |
| cricket::kGoogleSctpDataCodecName); |
| codec_port.SetParam(cricket::kCodecParamPort, sctp_port); |
| LOG(INFO) << "AddSctpDataCodec: Got SCTP Port Number " |
| @@ -2185,9 +2187,7 @@ void MaybeCreateStaticPayloadAudioCodecs( |
| return; |
| } |
| RTC_DCHECK(media_desc->codecs().empty()); |
| - std::vector<int>::const_iterator it = fmts.begin(); |
| - for (; it != fmts.end(); ++it) { |
| - int payload_type = *it; |
| + for (int payload_type : fmts) { |
| if (!media_desc->HasCodec(payload_type) && |
| payload_type >= 0 && |
| static_cast<uint32_t>(payload_type) < |