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

Unified Diff: webrtc/modules/audio_coding/neteq/tools/neteq_packet_source_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_packet_source_input.cc
diff --git a/webrtc/modules/audio_coding/neteq/tools/neteq_packet_source_input.cc b/webrtc/modules/audio_coding/neteq/tools/neteq_packet_source_input.cc
index 5c7c1edd5fcefabb8461823f258141d4dd5f763a..9af20898fdd097a9ec7e6b766d4a325ba5a0e510 100644
--- a/webrtc/modules/audio_coding/neteq/tools/neteq_packet_source_input.cc
+++ b/webrtc/modules/audio_coding/neteq/tools/neteq_packet_source_input.cc
@@ -43,8 +43,16 @@ std::unique_ptr<NetEqInput::PacketData> NetEqPacketSourceInput::PopPacket() {
}
std::unique_ptr<PacketData> packet_data(new PacketData);
packet_->ConvertHeader(&packet_data->header);
- packet_data->payload.SetData(packet_->payload(),
- packet_->payload_length_bytes());
+ if (packet_->payload_length_bytes() == 0 &&
+ packet_->virtual_payload_length_bytes() > 0) {
+ // This is a header-only "dummy" packet. Set the payload to all zeros, with
+ // length according to the virtual length.
+ packet_data->payload.SetSize(packet_->virtual_payload_length_bytes());
+ std::fill_n(packet_data->payload.data(), packet_data->payload.size(), 0);
+ } else {
+ packet_data->payload.SetData(packet_->payload(),
+ packet_->payload_length_bytes());
+ }
packet_data->time_ms = packet_->time_ms();
LoadNextPacket();

Powered by Google App Engine
This is Rietveld 408576698