diff --git a/webrtc/modules/audio_coding/neteq/tools/packet.cc b/webrtc/modules/audio_coding/neteq/tools/packet.cc index 0430933824..901aa850d5 100644 --- a/webrtc/modules/audio_coding/neteq/tools/packet.cc +++ b/webrtc/modules/audio_coding/neteq/tools/packet.cc @@ -129,8 +129,13 @@ void Packet::DeleteRedHeaders(std::list* headers) { bool Packet::ParseHeader(const RtpHeaderParser& parser) { bool valid_header = parser.Parse( payload_memory_.get(), static_cast(packet_length_bytes_), &header_); - assert(valid_header); - if (!valid_header) { + // Special case for dummy packets that have padding marked in the RTP header. + // This causes the RTP header parser to report failure, but is fine in this + // context. + const bool header_only_with_padding = + (header_.headerLength == packet_length_bytes_ && + header_.paddingLength > 0); + if (!valid_header && !header_only_with_padding) { return false; } assert(header_.headerLength <= packet_length_bytes_); diff --git a/webrtc/modules/audio_coding/neteq/tools/rtc_event_log_source.cc b/webrtc/modules/audio_coding/neteq/tools/rtc_event_log_source.cc index e0b54cb4d1..d9692e06e8 100644 --- a/webrtc/modules/audio_coding/neteq/tools/rtc_event_log_source.cc +++ b/webrtc/modules/audio_coding/neteq/tools/rtc_event_log_source.cc @@ -75,6 +75,7 @@ std::unique_ptr RtcEventLogSource::NextPacket() { // Check if the packet should not be filtered out. if (!filter_.test(packet->header().payloadType) && !(use_ssrc_filter_ && packet->header().ssrc != ssrc_)) { + ++rtp_packet_index_; return packet; } } diff --git a/webrtc/modules/audio_coding/neteq/tools/rtp_file_source.cc b/webrtc/modules/audio_coding/neteq/tools/rtp_file_source.cc index 9ca48e9ea5..814def12db 100644 --- a/webrtc/modules/audio_coding/neteq/tools/rtp_file_source.cc +++ b/webrtc/modules/audio_coding/neteq/tools/rtp_file_source.cc @@ -72,8 +72,7 @@ std::unique_ptr RtpFileSource::NextPacket() { packet_memory.release(), temp_packet.length, temp_packet.original_length, temp_packet.time_ms, *parser_.get())); if (!packet->valid_header()) { - assert(false); - return NULL; + continue; } if (filter_.test(packet->header().payloadType) || (use_ssrc_filter_ && packet->header().ssrc != ssrc_)) {