mirror of
https://github.com/jech/galene.git
synced 2024-11-25 01:55:57 +01:00
Don't count NACK recovery as properly received packets.
This commit is contained in:
parent
78cf9d0dbc
commit
100f72e76c
2 changed files with 15 additions and 1 deletions
|
@ -10,6 +10,7 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"io"
|
"io"
|
||||||
"log"
|
"log"
|
||||||
|
"math/bits"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
@ -701,7 +702,11 @@ func sendREMB(pc *webrtc.PeerConnection, ssrc uint32, bitrate uint64) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (up *upConnection) sendNACK(track *upTrack, first uint16, bitmap uint16) error {
|
func (up *upConnection) sendNACK(track *upTrack, first uint16, bitmap uint16) error {
|
||||||
return sendNACK(up.pc, track.track.SSRC(), first, bitmap)
|
err := sendNACK(up.pc, track.track.SSRC(), first, bitmap)
|
||||||
|
if err == nil {
|
||||||
|
track.cache.Expect(1 + bits.OnesCount16(bitmap))
|
||||||
|
}
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func sendNACK(pc *webrtc.PeerConnection, ssrc uint32, first uint16, bitmap uint16) error {
|
func sendNACK(pc *webrtc.PeerConnection, ssrc uint32, first uint16, bitmap uint16) error {
|
||||||
|
|
|
@ -114,6 +114,15 @@ func (cache *Cache) Store(seqno uint16, buf []byte) uint16 {
|
||||||
return cache.first
|
return cache.first
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (cache *Cache) Expect(n int) {
|
||||||
|
if n <= 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
cache.mu.Lock()
|
||||||
|
defer cache.mu.Unlock()
|
||||||
|
cache.expected += uint32(n)
|
||||||
|
}
|
||||||
|
|
||||||
func (cache *Cache) Get(seqno uint16) []byte {
|
func (cache *Cache) Get(seqno uint16) []byte {
|
||||||
cache.mu.Lock()
|
cache.mu.Lock()
|
||||||
defer cache.mu.Unlock()
|
defer cache.mu.Unlock()
|
||||||
|
|
Loading…
Reference in a new issue