Restart nacker on OOB sequence number restart. (#4368)

Clears NACKs based on old sequence number base and restarts it.
Also rename the function to be more reflective of what stats lite is
for.
This commit is contained in:
Raja Subramanian
2026-03-17 09:16:08 +05:30
committed by GitHub
parent 4a9e004555
commit cdfaacfca3
+19 -14
View File
@@ -477,13 +477,14 @@ func (b *BufferBase) stopRTPStats(reason string) (stats *livekit.RTPStats, stats
if b.rtpStats != nil { if b.rtpStats != nil {
b.rtpStats.Stop() b.rtpStats.Stop()
stats = b.rtpStats.ToProto() stats = b.rtpStats.ToProto()
b.logger.Debugw(
"rtp stats",
"direction", "upstream",
"stats", b.rtpStats,
"reason", reason,
)
} }
b.logger.Debugw(
"rtp stats",
"direction", "upstream",
"stats", b.rtpStats,
"reason", reason,
)
statsLite = b.stopRTPStatsLite(reason) statsLite = b.stopRTPStatsLite(reason)
return return
@@ -493,23 +494,27 @@ func (b *BufferBase) stopRTPStatsLite(reason string) (statsLite *livekit.RTPStat
if b.rtpStatsLite != nil { if b.rtpStatsLite != nil {
b.rtpStatsLite.Stop() b.rtpStatsLite.Stop()
statsLite = b.rtpStatsLite.ToProto() statsLite = b.rtpStatsLite.ToProto()
}
b.logger.Debugw( b.logger.Debugw(
"rtp stats lite", "rtp stats lite",
"direction", "upstream", "direction", "upstream",
"statsLite", b.rtpStatsLite, "statsLite", b.rtpStatsLite,
"reason", reason, "reason", reason,
) )
}
return return
} }
func (b *BufferBase) RestartStatsLite(reason string) { func (b *BufferBase) RestartOOBSequenceNumber(reason string) {
b.Lock() b.Lock()
defer b.Unlock() defer b.Unlock()
b.stopRTPStatsLite(reason) b.stopRTPStatsLite(reason)
b.setupRTPStatsLite(b.clockRate) b.setupRTPStatsLite(b.clockRate)
if b.nacker != nil {
b.nacker = nack.NewNACKQueue(nack.NackQueueParamsDefault)
}
} }
func (b *BufferBase) MarkForRestartStream(reason string) { func (b *BufferBase) MarkForRestartStream(reason string) {