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

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: 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..0a0304e485c97a8d984d6d852ed6402d9dcd4043 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_sender.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_sender.cc
@@ -207,13 +207,17 @@ RtcpMode RTCPSender::Status() const {
void RTCPSender::SetRTCPStatus(RtcpMode method) {
rtc::CritScope lock(&critical_section_rtcp_sender_);
+ bool was_off = (method_ == RtcpMode::kOff);
pbos-webrtc 2016/03/29 17:48:46 remove ()s
skvlad 2016/03/29 18:09:25 Done.
method_ = method;
if (method == RtcpMode::kOff)
return;
- next_time_to_send_rtcp_ =
- clock_->TimeInMilliseconds() +
- (audio_ ? RTCP_INTERVAL_AUDIO_MS / 2 : RTCP_INTERVAL_VIDEO_MS / 2);
+
+ if (was_off) {
+ next_time_to_send_rtcp_ =
+ clock_->TimeInMilliseconds() +
+ (audio_ ? RTCP_INTERVAL_AUDIO_MS / 2 : RTCP_INTERVAL_VIDEO_MS / 2);
+ }
pthatcher1 2016/03/25 23:03:40 Might be more clear as: if (method == method_)
skvlad 2016/03/29 18:09:25 There are three possible values for RtcpMode: kOff
pthatcher 2016/03/29 18:53:09 Ah, true. Well, how about this? if (method == m
skvlad 2016/03/29 19:51:31 Good idea; i've replaced it with a slightly modifi
}
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