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 d5bd97d45943dcec00cbcf6476a29f4f6a38aa00..c9163a15d8b993b3ea24562df252fc97c8bd3349 100644 |
--- a/webrtc/modules/audio_coding/neteq/tools/neteq_replacement_input.cc |
+++ b/webrtc/modules/audio_coding/neteq/tools/neteq_replacement_input.cc |
@@ -85,12 +85,12 @@ void NetEqReplacementInput::ReplacePacket() { |
rtc::Optional<RTPHeader> next_hdr = source_->NextHeader(); |
RTC_DCHECK(next_hdr); |
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; |
+ uint32_t input_frame_size_timestamps = last_frame_size_timestamps_; |
+ if (next_hdr->sequenceNumber == packet_->header.header.sequenceNumber + 1) { |
+ // Packets are in order. |
+ input_frame_size_timestamps = |
+ next_hdr->timestamp - packet_->header.header.timestamp; |
+ last_frame_size_timestamps_ = input_frame_size_timestamps; |
} |
FakeDecodeFromFile::PrepareEncoded(packet_->header.header.timestamp, |
input_frame_size_timestamps, |