Take next packet index into account when sending NACKs.

This avoids sending NACKs for packets in the future.
This commit is contained in:
Juliusz Chroboczek
2020-10-04 12:51:56 +02:00
parent 67a821ea75
commit 4a8e48d146
3 changed files with 38 additions and 21 deletions
+2 -1
View File
@@ -61,7 +61,8 @@ func readLoop(conn *rtpUpConnection, track *rtpUpTrack) {
packet.SequenceNumber, packet.Timestamp, kf, buf[:bytes],
)
if packet.SequenceNumber-first > 24 {
found, first, bitmap := track.cache.BitmapGet()
found, first, bitmap :=
track.cache.BitmapGet(packet.SequenceNumber - 4)
if found {
err := conn.sendNACK(track, first, bitmap)
if err != nil {