Recalc gap of sequence number after forcing rollover. (#2880)

This commit is contained in:
Raja Subramanian
2024-07-18 18:58:10 +05:30
committed by GitHub
parent afda860162
commit 91782b68be
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -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)
+2 -1
View File
@@ -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)
}
}