Index: webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc |
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc |
index 0763ba9a2c28f03021d5c5a701c7dcf2fe6ecd63..e58ac3c61bb6f41c998c743ef3c9a0d5d8d59cec 100644 |
--- a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc |
+++ b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc |
@@ -105,11 +105,6 @@ |
uint32_t SSRC = rtp_sender_.SSRC(); |
rtcp_sender_.SetSSRC(SSRC); |
SetRtcpReceiverSsrcs(SSRC); |
- |
- // Make sure rtcp sender use same timestamp offset as rtp sender. |
- rtcp_sender_.SetTimestampOffset(rtp_sender_.TimestampOffset()); |
- |
- // Set default packet size limit. |
SetMaxTransferUnit(IP_PACKET_SIZE); |
} |
@@ -267,13 +262,13 @@ |
} |
uint32_t ModuleRtpRtcpImpl::StartTimestamp() const { |
- return rtp_sender_.TimestampOffset(); |
+ return rtp_sender_.StartTimestamp(); |
} |
// Configure start timestamp, default is a random number. |
void ModuleRtpRtcpImpl::SetStartTimestamp(const uint32_t timestamp) { |
- rtcp_sender_.SetTimestampOffset(timestamp); |
- rtp_sender_.SetTimestampOffset(timestamp); |
+ rtcp_sender_.SetStartTimestamp(timestamp); |
+ rtp_sender_.SetStartTimestamp(timestamp, true); |
} |
uint16_t ModuleRtpRtcpImpl::SequenceNumber() const { |
@@ -286,8 +281,8 @@ |
} |
void ModuleRtpRtcpImpl::SetRtpState(const RtpState& rtp_state) { |
+ SetStartTimestamp(rtp_state.start_timestamp); |
rtp_sender_.SetRtpState(rtp_state); |
- rtcp_sender_.SetTimestampOffset(rtp_state.start_timestamp); |
} |
void ModuleRtpRtcpImpl::SetRtxState(const RtpState& rtp_state) { |
@@ -358,8 +353,13 @@ |
collision_detected_ = false; |
+ // Generate a new time_stamp if true and not configured via API |
// Generate a new SSRC for the next "call" if false |
rtp_sender_.SetSendingStatus(sending); |
+ if (sending) { |
+ // Make sure the RTCP sender has the same timestamp offset. |
+ rtcp_sender_.SetStartTimestamp(rtp_sender_.StartTimestamp()); |
+ } |
// Make sure that RTCP objects are aware of our SSRC (it could have changed |
// Due to collision) |