A recent change (https://codereview.webrtc.org/2855143002/) introduced
a bug in RtcEventLogSource::NextPacket(). The rtp_packet_index_ must
be incremented when a valid packet is found and delivered. Otherwise,
the same packet will be delivered over and over again.
The recent change also altered the way that audio packets are sifted out. Now, the RTP header is always parsed before discarding any non-audio packets. This means that RtpHeaderParser::Parse is always called, also with video packets, which sometimes contain padding. When header-only dumps (such as RtcEventLogs) are created, the payload is stripped, and the payload length is equal to
the RTP header length. However, if the original packet was padded, the
RTP header will carry information about this padding length, and the
parser will check that the pyaload length is at least the header +
padding. This is not the case for header-only dumps, and the parser will return an error. In this CL, we ignore that error when a header-only packet has padding length larger than 0.
BUG=webrtc:7538
Review-Url: https://codereview.webrtc.org/2912323003
Cr-Commit-Position: refs/heads/master@{#18385}