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

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

Issue 1715703002: Fix sequence-number replay race for padding. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: 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/video/end_to_end_tests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/rtp_rtcp/source/rtp_sender.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_sender.cc b/webrtc/modules/rtp_rtcp/source/rtp_sender.cc
index c831b5132a7c9befdd4187a2e008b3b225ef99e9..97469ca35ecf27defdfc971376e4d6ff6399b23d 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_sender.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_sender.cc
@@ -556,6 +556,8 @@ int32_t RTPSender::SendOutgoingData(FrameType frame_type,
size_t RTPSender::TrySendRedundantPayloads(size_t bytes_to_send) {
{
rtc::CritScope lock(&send_critsect_);
+ if (!sending_media_)
+ return 0;
if ((rtx_ & kRtxRedundantPayloads) == 0)
return 0;
}
@@ -618,6 +620,8 @@ size_t RTPSender::SendPadData(size_t bytes,
bool over_rtx;
{
rtc::CritScope lock(&send_critsect_);
+ if (!sending_media_)
+ return bytes_sent;
if (!timestamp_provided) {
timestamp = timestamp_;
capture_time_ms = capture_time_ms_;
@@ -1011,11 +1015,6 @@ bool RTPSender::IsFecPacket(const uint8_t* buffer,
size_t RTPSender::TimeToSendPadding(size_t bytes) {
if (audio_configured_ || bytes == 0)
return 0;
- {
pbos-webrtc 2016/02/19 15:11:29 This check is now done in TrySendRedundantPayloads
- rtc::CritScope lock(&send_critsect_);
- if (!sending_media_)
- return 0;
- }
size_t bytes_sent = TrySendRedundantPayloads(bytes);
if (bytes_sent < bytes)
bytes_sent += SendPadData(bytes - bytes_sent, false, 0, 0);
« no previous file with comments | « no previous file | webrtc/video/end_to_end_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698