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

View File

@@ -477,13 +477,14 @@ func (b *BufferBase) stopRTPStats(reason string) (stats *livekit.RTPStats, stats
if b.rtpStats != nil {
b.rtpStats.Stop()
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)
return
@@ -493,23 +494,27 @@ func (b *BufferBase) stopRTPStatsLite(reason string) (statsLite *livekit.RTPStat
if b.rtpStatsLite != nil {
b.rtpStatsLite.Stop()
statsLite = b.rtpStatsLite.ToProto()
}
b.logger.Debugw(
"rtp stats lite",
"direction", "upstream",
"statsLite", b.rtpStatsLite,
"reason", reason,
)
b.logger.Debugw(
"rtp stats lite",
"direction", "upstream",
"statsLite", b.rtpStatsLite,
"reason", reason,
)
}
return
}
func (b *BufferBase) RestartStatsLite(reason string) {
func (b *BufferBase) RestartOOBSequenceNumber(reason string) {
b.Lock()
defer b.Unlock()
b.stopRTPStatsLite(reason)
b.setupRTPStatsLite(b.clockRate)
if b.nacker != nil {
b.nacker = nack.NewNACKQueue(nack.NackQueueParamsDefault)
}
}
func (b *BufferBase) MarkForRestartStream(reason string) {