mirror of
https://github.com/livekit/livekit.git
synced 2026-05-25 14:15:15 +00:00
Recalc gap of sequence number after forcing rollover. (#2880)
This commit is contained in:
@@ -827,9 +827,9 @@ func (b *Buffer) getExtPacket(rtpPacket *rtp.Packet, arrivalTime int64, flowStat
|
||||
} else {
|
||||
// vp8 with DependencyDescriptor enabled, use the TID from the descriptor
|
||||
vp8Packet.TID = uint8(ep.Temporal)
|
||||
ep.Spatial = InvalidLayerSpatial // vp8 don't have spatial scalability, reset to invalid
|
||||
}
|
||||
ep.Payload = vp8Packet
|
||||
ep.Spatial = InvalidLayerSpatial // vp8 don't have spatial scalability, reset to invalid
|
||||
|
||||
case "video/vp9":
|
||||
if ep.DependencyDescriptor == nil {
|
||||
@@ -849,6 +849,7 @@ func (b *Buffer) getExtPacket(rtpPacket *rtp.Packet, arrivalTime int64, flowStat
|
||||
|
||||
case "video/h264":
|
||||
ep.KeyFrame = IsH264KeyFrame(rtpPacket.Payload)
|
||||
ep.Spatial = InvalidLayerSpatial // h.264 don't have spatial scalability, reset to invalid
|
||||
|
||||
case "video/av1":
|
||||
ep.KeyFrame = IsAV1KeyFrame(rtpPacket.Payload)
|
||||
|
||||
@@ -227,7 +227,7 @@ func (r *RTPStatsReceiver) Update(
|
||||
gapTS := int64(resTS.ExtendedVal - resTS.PreExtendedHighest)
|
||||
|
||||
// it is possible that sequence number has rolled over too
|
||||
if gapSN < 0 && gapTS > 0 {
|
||||
if gapSN < 0 && gapTS > 0 && payloadSize > 0 {
|
||||
// not possible to know how many cycles of sequence number roll over could have happened,
|
||||
// use 1 to ensure that it at least does not go backwards
|
||||
resSN = r.sequenceNumber.Rollover(sequenceNumber, 1)
|
||||
@@ -240,6 +240,7 @@ func (r *RTPStatsReceiver) Update(
|
||||
"forcing sequence number rollover", nil,
|
||||
getLoggingFields()...,
|
||||
)
|
||||
gapSN = int64(resSN.ExtendedVal - resSN.PreExtendedHighest)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user