rtpdump icon indicating copy to clipboard operation
rtpdump copied to clipboard

a bug(rtp rtpStream )

Open wanglong001 opened this issue 5 years ago • 0 comments

hi, 我找到一个bug, SequenceNumber 是uint16,不断增加的, 最大值是 65535, 到65535后会溢出, 又从0开始.


func (r *RtpStream) AddPacket(rtp *RtpPacket) {
    if  r.CurSeq == 65535 {
        r.CurSeq = 0
    }
    if rtp.SequenceNumber <= r.CurSeq {
        return
    }
    r.EndTime = rtp.ReceivedAt
    r.CurSeq = rtp.SequenceNumber
    r.TotalExpectedPackets = uint(r.CurSeq - r.FirstSeq)
    r.LostPackets = r.TotalExpectedPackets - uint(len(r.RtpPackets))
    r.RtpPackets = append(r.RtpPackets, rtp)
}

wanglong001 avatar Apr 28 '19 05:04 wanglong001