1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-11-22 08:35:57 +01:00

Improve timing of nackWriter.

This commit is contained in:
Juliusz Chroboczek 2020-10-31 21:31:05 +01:00
parent b46da173e5
commit 2efb5b3cea

View file

@ -384,17 +384,19 @@ func rtpWriterLoop(writer *rtpWriter, up *rtpUpConnection, track *rtpUpTrack) {
func nackWriter(conn *rtpUpConnection, track *rtpUpTrack) {
// a client might send us a NACK for a packet that has already
// been nacked by the reader loop. Give recovery a chance.
time.Sleep(100 * time.Millisecond)
time.Sleep(50 * time.Millisecond)
track.mu.Lock()
nacks := track.bufferedNACKs
track.bufferedNACKs = nil
track.mu.Unlock()
if !track.hasRtcpFb("nack", "") {
if len(nacks) == 0 || !track.hasRtcpFb("nack", "") {
return
}
time.Sleep(50 * time.Millisecond)
// drop any nacks before the last keyframe
var cutoff uint16
found, seqno, _ := track.cache.KeyframeSeqno()