From c96aa30c1397e1f5e9cda06330413e946b55ea13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Spr=C3=A5ng?= Date: Thu, 25 Feb 2021 17:05:21 +0100 Subject: [PATCH] Minor refactoring of RtpVideoSender MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: None Change-Id: I7cc16d4e435974090310bd3a7cea9eaf0586be8c Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/208761 Reviewed-by: Niels Moller Commit-Queue: Erik Språng Cr-Commit-Position: refs/heads/master@{#33351} --- call/rtp_video_sender.cc | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/call/rtp_video_sender.cc b/call/rtp_video_sender.cc index 732d17a5c5..1f17c7e989 100644 --- a/call/rtp_video_sender.cc +++ b/call/rtp_video_sender.cc @@ -497,28 +497,27 @@ void RtpVideoSender::SetActiveModulesLocked( active_ = true; } - const bool was_active = rtp_streams_[i].rtp_rtcp->SendingMedia(); + RtpRtcpInterface& rtp_module = *rtp_streams_[i].rtp_rtcp; + const bool was_active = rtp_module.SendingMedia(); const bool should_be_active = active_modules[i]; // Sends a kRtcpByeCode when going from true to false. - rtp_streams_[i].rtp_rtcp->SetSendingStatus(active_modules[i]); + rtp_module.SetSendingStatus(active_modules[i]); if (was_active && !should_be_active) { // Disabling media, remove from packet router map to reduce size and // prevent any stray packets in the pacer from asynchronously arriving // to a disabled module. - transport_->packet_router()->RemoveSendRtpModule( - rtp_streams_[i].rtp_rtcp.get()); + transport_->packet_router()->RemoveSendRtpModule(&rtp_module); } // If set to false this module won't send media. - rtp_streams_[i].rtp_rtcp->SetSendingMediaStatus(active_modules[i]); + rtp_module.SetSendingMediaStatus(active_modules[i]); if (!was_active && should_be_active) { // Turning on media, register with packet router. - transport_->packet_router()->AddSendRtpModule( - rtp_streams_[i].rtp_rtcp.get(), - /*remb_candidate=*/true); + transport_->packet_router()->AddSendRtpModule(&rtp_module, + /*remb_candidate=*/true); } } }