Accept more range for first packet time adjustment. (#2150)

This commit is contained in:
Raja Subramanian
2023-10-17 23:52:14 +05:30
committed by GitHub
parent 11c9c56a4d
commit 3e4cd3a161
7 changed files with 30 additions and 31 deletions
+5 -9
View File
@@ -84,8 +84,7 @@ type Buffer struct {
closed atomic.Bool
mime string
snRangeMap *utils.RangeMap[uint64, uint64]
paddingOnlyDrops uint64
snRangeMap *utils.RangeMap[uint64, uint64]
latestTSForAudioLevelInitialized bool
latestTSForAudioLevel uint32
@@ -455,7 +454,6 @@ func (b *Buffer) calc(pkt []byte, arrivalTime time.Time) {
if err := b.snRangeMap.ExcludeRange(flowState.ExtSequenceNumber, flowState.ExtSequenceNumber+1); err != nil {
b.logger.Errorw("could not exclude range", err, "sn", rtpPacket.SequenceNumber, "esn", flowState.ExtSequenceNumber)
}
b.paddingOnlyDrops++
}
return
}
@@ -717,14 +715,12 @@ func (b *Buffer) buildReceptionReport() *rtcp.ReceptionReport {
return b.rtpStats.GetRtcpReceptionReport(b.mediaSSRC, b.lastFractionLostToReport, b.rrSnapshotId)
}
func (b *Buffer) SetSenderReportData(rtpTime uint32, ntpTime uint64, packetCount uint32) {
func (b *Buffer) SetSenderReportData(rtpTime uint32, ntpTime uint64) {
b.RLock()
srData := &RTCPSenderReportData{
RTPTimestamp: rtpTime,
NTPTimestamp: mediatransportutil.NtpTime(ntpTime),
PacketCount: packetCount,
PaddingOnlyDrops: b.paddingOnlyDrops,
At: time.Now(),
RTPTimestamp: rtpTime,
NTPTimestamp: mediatransportutil.NtpTime(ntpTime),
At: time.Now(),
}
if b.rtpStats != nil {