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

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

Issue 1674963004: Always append the BYE packet type at the end (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Removed Comment Created 4 years, 10 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
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/rtcp_sender_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5b42fa19718649f22392cd764c0fbe74a19077ee..4a97ef8c9006fdc65b895d6250726b0b27b08a37 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_sender.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_sender.cc
@@ -835,6 +835,8 @@ int32_t RTCPSender::SendCompoundRTCP(
PrepareReport(packet_types, feedback_state);
+ rtc::scoped_ptr<rtcp::RtcpPacket> packet_bye;
+
auto it = report_flags_.begin();
while (it != report_flags_.end()) {
auto builder_it = builders_.find(it->type);
@@ -849,7 +851,18 @@ int32_t RTCPSender::SendCompoundRTCP(
rtc::scoped_ptr<rtcp::RtcpPacket> packet = (this->*func)(context);
if (packet.get() == nullptr)
return -1;
- container.Append(packet.release());
+ // If there is a BYE, don't append now - save it and append it
+ // at the end later.
+ if (builder_it->first == kRtcpBye) {
+ packet_bye = std::move(packet);
+ } else {
+ container.Append(packet.release());
+ }
+ }
+
+ // Append the BYE now at the end
+ if (packet_bye) {
+ container.Append(packet_bye.release());
}
if (packet_type_counter_observer_ != nullptr) {
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/rtcp_sender_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698