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:
parent
b46da173e5
commit
2efb5b3cea
1 changed files with 4 additions and 2 deletions
|
@ -384,17 +384,19 @@ func rtpWriterLoop(writer *rtpWriter, up *rtpUpConnection, track *rtpUpTrack) {
|
||||||
func nackWriter(conn *rtpUpConnection, track *rtpUpTrack) {
|
func nackWriter(conn *rtpUpConnection, track *rtpUpTrack) {
|
||||||
// a client might send us a NACK for a packet that has already
|
// a client might send us a NACK for a packet that has already
|
||||||
// been nacked by the reader loop. Give recovery a chance.
|
// been nacked by the reader loop. Give recovery a chance.
|
||||||
time.Sleep(100 * time.Millisecond)
|
time.Sleep(50 * time.Millisecond)
|
||||||
|
|
||||||
track.mu.Lock()
|
track.mu.Lock()
|
||||||
nacks := track.bufferedNACKs
|
nacks := track.bufferedNACKs
|
||||||
track.bufferedNACKs = nil
|
track.bufferedNACKs = nil
|
||||||
track.mu.Unlock()
|
track.mu.Unlock()
|
||||||
|
|
||||||
if !track.hasRtcpFb("nack", "") {
|
if len(nacks) == 0 || !track.hasRtcpFb("nack", "") {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
time.Sleep(50 * time.Millisecond)
|
||||||
|
|
||||||
// drop any nacks before the last keyframe
|
// drop any nacks before the last keyframe
|
||||||
var cutoff uint16
|
var cutoff uint16
|
||||||
found, seqno, _ := track.cache.KeyframeSeqno()
|
found, seqno, _ := track.cache.KeyframeSeqno()
|
||||||
|
|
Loading…
Reference in a new issue