Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Unified Diff: webrtc/modules/audio_coding/neteq/tools/neteq_replacement_input.cc

Issue 2319553003: Fixing NetEqReplacementInput for reordered and missing packets (Closed)
Patch Set: Fixing review comment and a lint nit Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/audio_coding/neteq/tools/neteq_replacement_input.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « webrtc/modules/audio_coding/neteq/tools/neteq_replacement_input.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698