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

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

Issue 2912323003: Fix a bug in RtcEventLogSource (Closed)
Patch Set: One more small fix Created 3 years, 7 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 | « no previous file | webrtc/modules/audio_coding/neteq/tools/rtc_event_log_source.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_coding/neteq/tools/packet.cc
diff --git a/webrtc/modules/audio_coding/neteq/tools/packet.cc b/webrtc/modules/audio_coding/neteq/tools/packet.cc
index 0430933824e1c3303e51a78a696d5d6a0d4c1372..901aa850d539506ac5c9ab47b5abc4166904cdeb 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<RTPHeader*>* headers) {
bool Packet::ParseHeader(const RtpHeaderParser& parser) {
bool valid_header = parser.Parse(
payload_memory_.get(), static_cast<int>(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_);
« no previous file with comments | « no previous file | webrtc/modules/audio_coding/neteq/tools/rtc_event_log_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698