Commit 2efb5b3c authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Improve timing of nackWriter.

parent b46da173
......@@ -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()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment