Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Unified Diff: webrtc/modules/rtp_rtcp/source/rtcp_sender.cc

Issue 2758533002: Fix rtcp_sender to support sdes with 31 chunk (Closed)
Patch Set: +todo Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/rtp_rtcp/source/rtcp_sender.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_sender.cc b/webrtc/modules/rtp_rtcp/source/rtcp_sender.cc
index 5f2eb759c96937cccb48d44f421e4f8a22a4c534..56d991c80fd4d457a945a9205c57c32c3b6ac2c2 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_sender.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_sender.cc
@@ -327,7 +327,10 @@ int32_t RTCPSender::AddMixedCNAME(uint32_t SSRC, const char* c_name) {
RTC_DCHECK(c_name);
RTC_DCHECK_LT(strlen(c_name), RTCP_CNAME_SIZE);
rtc::CritScope lock(&critical_section_rtcp_sender_);
- if (csrc_cnames_.size() >= kRtpCsrcSize)
+ // One spot is reserved for ssrc_/cname_.
+ // TODO(danilchap): Add support for more than 30 contributes by sending
+ // several sdes packets.
+ if (csrc_cnames_.size() >= rtcp::Sdes::kMaxNumberOfChunks - 1)
return -1;
csrc_cnames_[SSRC] = c_name;
@@ -463,8 +466,8 @@ std::unique_ptr<rtcp::RtcpPacket> RTCPSender::BuildSDES(
rtcp::Sdes* sdes = new rtcp::Sdes();
sdes->AddCName(ssrc_, cname_);
- for (const auto it : csrc_cnames_)
- sdes->AddCName(it.first, it.second);
+ for (const auto& it : csrc_cnames_)
+ RTC_CHECK(sdes->AddCName(it.first, it.second));
return std::unique_ptr<rtcp::RtcpPacket>(sdes);
}
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_packet/sdes.cc ('k') | webrtc/modules/rtp_rtcp/source/rtcp_sender_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698