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

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

Issue 1826093004: Avoid rescheduling the next RTCP packet if the RTCP sender status doesn't change. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rewrote the condition to make it easier to read Created 4 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
« no previous file with comments | « no previous file | no next file » | 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 a5fccebad1dd67eb792fcf70ae402fafdcac5700..ed2d319906b873a6b3e9dc23d52ea0112b263e55 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_sender.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_sender.cc
@@ -205,15 +205,16 @@ RtcpMode RTCPSender::Status() const {
return method_;
}
-void RTCPSender::SetRTCPStatus(RtcpMode method) {
+void RTCPSender::SetRTCPStatus(RtcpMode new_method) {
rtc::CritScope lock(&critical_section_rtcp_sender_);
- method_ = method;
- if (method == RtcpMode::kOff)
- return;
- next_time_to_send_rtcp_ =
+ if (method_ == RtcpMode::kOff && new_method != RtcpMode::kOff) {
+ // When switching on, reschedule the next packet
+ next_time_to_send_rtcp_ =
clock_->TimeInMilliseconds() +
(audio_ ? RTCP_INTERVAL_AUDIO_MS / 2 : RTCP_INTERVAL_VIDEO_MS / 2);
+ }
+ method_ = new_method;
}
bool RTCPSender::Sending() const {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698