Duplicate packets should not update packet loss counter (#417)

This commit is contained in:
Raja Subramanian
2022-02-08 16:32:49 +05:30
committed by GitHub
parent d3ca4a37a8
commit e948ecb3a8
+6 -4
View File
@@ -381,10 +381,12 @@ func (b *Buffer) updateStreamState(p *rtp.Packet, pktSize int, arrivalTime int64
b.nacker.Remove(sn)
}
} else {
b.stats.TotalPacketsLost += (uint32(diff) - 1)
if b.nacker != nil && diff > 1 {
for lost := b.highestSN + 1; lost != sn; lost++ {
b.nacker.Push(lost)
if diff > 1 {
b.stats.TotalPacketsLost += (uint32(diff) - 1)
if b.nacker != nil {
for lost := b.highestSN + 1; lost != sn; lost++ {
b.nacker.Push(lost)
}
}
}