add log for extpacket accumulated (#2454)

This commit is contained in:
cnderrauber authored and GitHub committed 2024-02-06 21:38:36 +08:00
1 parent 2f9ec2117f
commit af0a8fbbbc
3 files changed
+12 -5

No files matched your search

+9 -2
View File
@@ -121,8 +121,9 @@ type Buffer struct {
frameRateCalculator [DefaultMaxLayerSpatial + 1]FrameRateCalculator
frameRateCalculated bool
packetNotFoundCount atomic.Uint32
packetTooOldCount atomic.Uint32
packetNotFoundCount atomic.Uint32
packetTooOldCount atomic.Uint32
extPacketTooMuchCount atomic.Uint32
primaryBufferForRTX *Buffer
}
@@ -570,6 +571,12 @@ func (b *Buffer) calc(rawPkt []byte, rtpPacket *rtp.Packet, arrivalTime time.Tim
}
b.extPackets.PushBack(ep)
if b.extPackets.Len() > b.bucket.Capacity() {
if (b.extPacketTooMuchCount.Inc()-1)%100 == 0 {
b.logger.Warnw("too much ext packets", nil, "count", b.extPackets.Len())
}
}
b.doFpsCalc(ep)
}