Index: media/cast/transport/rtp_sender/rtp_sender.cc |
diff --git a/media/cast/transport/rtp_sender/rtp_sender.cc b/media/cast/transport/rtp_sender/rtp_sender.cc |
index 9f891193a53c091cc3b2bb0ca7b859331cfb6a49..3bb7e25a422a42e1bc38fa23b555debaa10042e6 100644 |
--- a/media/cast/transport/rtp_sender/rtp_sender.cc |
+++ b/media/cast/transport/rtp_sender/rtp_sender.cc |
@@ -36,10 +36,10 @@ RtpSender::RtpSender( |
RtpSender::~RtpSender() {} |
void RtpSender::InitializeAudio(const CastTransportAudioConfig& config) { |
- storage_.reset(new PacketStorage(clock_, config.base.rtp_config.history_ms)); |
+ storage_.reset(new PacketStorage(config.rtp.max_outstanding_frames)); |
config_.audio = true; |
- config_.ssrc = config.base.ssrc; |
- config_.payload_type = config.base.rtp_config.payload_type; |
+ config_.ssrc = config.rtp.config.ssrc; |
+ config_.payload_type = config.rtp.config.payload_type; |
config_.frequency = config.frequency; |
config_.audio_codec = config.codec; |
packetizer_.reset( |
@@ -47,10 +47,10 @@ void RtpSender::InitializeAudio(const CastTransportAudioConfig& config) { |
} |
void RtpSender::InitializeVideo(const CastTransportVideoConfig& config) { |
- storage_.reset(new PacketStorage(clock_, config.base.rtp_config.history_ms)); |
+ storage_.reset(new PacketStorage(config.rtp.max_outstanding_frames)); |
config_.audio = false; |
- config_.ssrc = config.base.ssrc; |
- config_.payload_type = config.base.rtp_config.payload_type; |
+ config_.ssrc = config.rtp.config.ssrc; |
+ config_.payload_type = config.rtp.config.payload_type; |
config_.frequency = kVideoFrequency; |
config_.video_codec = config.codec; |
packetizer_.reset( |
@@ -91,6 +91,10 @@ void RtpSender::ResendPackets( |
// Get packet from storage. |
success = storage_->GetPacket(frame_id, packet_id, &packets_to_resend); |
+ // Check that we got at least one packet. |
+ DCHECK(packet_id != 0 || success) |
+ << "Failed to resend frame " << static_cast<int>(frame_id); |
+ |
// Resend packet to the network. |
if (success) { |
VLOG(3) << "Resend " << static_cast<int>(frame_id) << ":" |
@@ -110,6 +114,10 @@ void RtpSender::ResendPackets( |
uint16 packet_id = *set_it; |
success = storage_->GetPacket(frame_id, packet_id, &packets_to_resend); |
+ // Check that we got at least one packet. |
+ DCHECK(set_it != packets_set.begin() || success) |
+ << "Failed to resend frame " << frame_id; |
+ |
// Resend packet to the network. |
if (success) { |
VLOG(3) << "Resend " << static_cast<int>(frame_id) << ":" |