diff --git a/webrtc/modules/rtp_rtcp/source/rtp_packet_history.cc b/webrtc/modules/rtp_rtcp/source/rtp_packet_history.cc index fc288b741..14ca821f7 100644 --- a/webrtc/modules/rtp_rtcp/source/rtp_packet_history.cc +++ b/webrtc/modules/rtp_rtcp/source/rtp_packet_history.cc @@ -254,12 +254,10 @@ bool RTPPacketHistory::GetPacketAndSetSendTime(uint16_t sequence_number, ((now - stored_send_times_.at(index)) < min_elapsed_time_ms)) { WEBRTC_TRACE(kTraceStream, kTraceRtpRtcp, -1, "Skip getting packet %u, packet recently resent.", sequence_number); - *packet_length = 0; - return true; + return false; } - if (length == 0 || - (retransmit && stored_types_.at(index) == kDontRetransmit)) { + if (retransmit && stored_types_.at(index) == kDontRetransmit) { // No bytes copied since this packet shouldn't be retransmitted or is // of zero size. return false; diff --git a/webrtc/modules/rtp_rtcp/source/rtp_packet_history_unittest.cc b/webrtc/modules/rtp_rtcp/source/rtp_packet_history_unittest.cc index d0bbf9222..1682b7c33 100644 --- a/webrtc/modules/rtp_rtcp/source/rtp_packet_history_unittest.cc +++ b/webrtc/modules/rtp_rtcp/source/rtp_packet_history_unittest.cc @@ -249,8 +249,7 @@ TEST_F(RtpPacketHistoryTest, MinResendTime) { // Time has not elapsed. Packet should be found, but no bytes copied. len = kMaxPacketLength; - EXPECT_TRUE(hist_->GetPacketAndSetSendTime(kSeqNum, 101, false, packet_, &len, - &time)); - EXPECT_EQ(0, len); + EXPECT_FALSE(hist_->GetPacketAndSetSendTime(kSeqNum, 101, false, packet_, + &len, &time)); } } // namespace webrtc diff --git a/webrtc/modules/rtp_rtcp/source/rtp_sender.cc b/webrtc/modules/rtp_rtcp/source/rtp_sender.cc index 60be77474..0f08573ef 100644 --- a/webrtc/modules/rtp_rtcp/source/rtp_sender.cc +++ b/webrtc/modules/rtp_rtcp/source/rtp_sender.cc @@ -560,7 +560,12 @@ int32_t RTPSender::ReSendPacket(uint16_t packet_id, uint32_t min_resend_time) { ModuleRTPUtility::RTPHeaderParser rtp_parser(data_buffer, length); RTPHeader header; - rtp_parser.Parse(header); + if (!rtp_parser.Parse(header)) { + assert(false); + WEBRTC_TRACE(kTraceError, kTraceRtpRtcp, id_, + "Failed to parse RTP header of packet to be retransmitted."); + return -1; + } TRACE_EVENT_INSTANT2("webrtc_rtp", "RTPSender::ReSendPacket", "timestamp", header.timestamp, "seqnum", header.sequenceNumber);