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(); |