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

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

Issue 2177523002: Fix issues with RestartingSendStreamPreservesRtpStatesWithRtx (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 4 years, 5 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 | « webrtc/modules/rtp_rtcp/source/rtp_sender.h ('k') | webrtc/modules/rtp_rtcp/source/rtp_sender_audio.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 0afc8d24389ce876e2304f3e8084d4b1ecc33bcc..2fe80ae90f5c154099a459287e76ea575439316a 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_sender.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_sender.cc
@@ -850,7 +850,8 @@ bool RTPSender::PrepareAndSendPacket(uint8_t* buffer,
uint8_t data_buffer_rtx[IP_PACKET_SIZE];
if (send_over_rtx) {
- BuildRtxPacket(buffer, &length, data_buffer_rtx);
+ if (!BuildRtxPacket(buffer, &length, data_buffer_rtx))
+ return false;
buffer_to_send_ptr = data_buffer_rtx;
}
@@ -1154,6 +1155,8 @@ int32_t RTPSender::BuildRtpHeader(uint8_t* data_buffer,
int64_t capture_time_ms) {
assert(payload_type >= 0);
rtc::CritScope lock(&send_critsect_);
+ if (!sending_media_)
+ return -1;
timestamp_ = start_timestamp_ + capture_timestamp;
last_timestamp_time_ms_ = clock_->TimeInMilliseconds();
@@ -1793,9 +1796,12 @@ int32_t RTPSender::SetFecParameters(
return 0;
}
-void RTPSender::BuildRtxPacket(uint8_t* buffer, size_t* length,
+bool RTPSender::BuildRtxPacket(uint8_t* buffer,
+ size_t* length,
uint8_t* buffer_rtx) {
rtc::CritScope lock(&send_critsect_);
+ if (!sending_media_)
+ return false;
uint8_t* data_buffer_rtx = buffer_rtx;
// Add RTX header.
RtpUtility::RtpHeaderParser rtp_parser(
@@ -1836,6 +1842,7 @@ void RTPSender::BuildRtxPacket(uint8_t* buffer, size_t* length,
memcpy(ptr, buffer + rtp_header.headerLength,
*length - rtp_header.headerLength);
*length += 2;
+ return true;
}
void RTPSender::RegisterRtpStatisticsCallback(
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_sender.h ('k') | webrtc/modules/rtp_rtcp/source/rtp_sender_audio.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698