Index: webrtc/modules/audio_coding/neteq/tools/neteq_replacement_input.cc |
diff --git a/webrtc/modules/audio_coding/neteq/tools/neteq_replacement_input.cc b/webrtc/modules/audio_coding/neteq/tools/neteq_replacement_input.cc |
index 2a940fedc4f688a8705b169d58a75b34cf3a15d3..d5bd97d45943dcec00cbcf6476a29f4f6a38aa00 100644 |
--- a/webrtc/modules/audio_coding/neteq/tools/neteq_replacement_input.cc |
+++ b/webrtc/modules/audio_coding/neteq/tools/neteq_replacement_input.cc |
@@ -84,11 +84,17 @@ void NetEqReplacementInput::ReplacePacket() { |
rtc::Optional<RTPHeader> next_hdr = source_->NextHeader(); |
RTC_DCHECK(next_hdr); |
- uint8_t payload[8]; |
+ uint8_t payload[12]; |
uint32_t input_frame_size_timestamps = |
next_hdr->timestamp - packet_->header.header.timestamp; |
+ if (next_hdr->sequenceNumber != packet_->header.header.sequenceNumber + 1) { |
+ // Gap in packet sequence. Cannot estimate payload length based on timestamp |
+ // difference. |
+ input_frame_size_timestamps = 0; |
+ } |
FakeDecodeFromFile::PrepareEncoded(packet_->header.header.timestamp, |
- input_frame_size_timestamps, payload); |
+ input_frame_size_timestamps, |
+ packet_->payload.size(), payload); |
packet_->payload.SetData(payload); |
packet_->header.header.payloadType = replacement_payload_type_; |
return; |