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

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

Issue 2275903002: Make FakeDecodeFromFile handle codec-internal CNG (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixing compile errors Created 4 years, 4 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
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;

Powered by Google App Engine
This is Rietveld 408576698