From bdfe6ae801cb6937478c61b21663fb20b79b991b Mon Sep 17 00:00:00 2001 From: Philipp Hancke Date: Mon, 8 Jul 2024 12:50:33 -0700 Subject: [PATCH] video_replay: ignore non-rtp packets which cause log spam otherwise, in particular RTCP packets BUG=None Change-Id: I73c2b17afb4f69102e25eb360699ea7d93bb8175 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/356100 Reviewed-by: Ilya Nikolaevskiy Commit-Queue: Philipp Hancke Reviewed-by: Mirko Bonadei Cr-Commit-Position: refs/heads/main@{#42643} --- rtc_tools/video_replay.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rtc_tools/video_replay.cc b/rtc_tools/video_replay.cc index 2dde05be34..a11f5692e5 100644 --- a/rtc_tools/video_replay.cc +++ b/rtc_tools/video_replay.cc @@ -609,9 +609,13 @@ class RtpReplayer final { packet.original_length - packet.length); packet_buffer.MutableData()[0] &= ~0x20; } + // Check that the packet is a RTP packet and is valid. + if (!IsRtpPacket({packet.data, packet.length})) { + continue; + } RtpPacket header; - header.Parse(packet_buffer); - if (header.Timestamp() < start_timestamp || + if (!header.Parse(packet_buffer) || + header.Timestamp() < start_timestamp || header.Timestamp() > stop_timestamp) { continue; }