Fix min TS before first sender report (#1724)
This commit is contained in:
@@ -808,6 +808,11 @@ func (r *RTPStats) GetExpectedRTPTimestamp(at time.Time) (uint32, uint32, error)
|
|||||||
timeDiff := at.Sub(r.firstTime)
|
timeDiff := at.Sub(r.firstTime)
|
||||||
expectedRTPDiff := timeDiff.Nanoseconds() * int64(r.params.ClockRate) / 1e9
|
expectedRTPDiff := timeDiff.Nanoseconds() * int64(r.params.ClockRate) / 1e9
|
||||||
expectedExtRTP := r.extStartTS + uint64(expectedRTPDiff)
|
expectedExtRTP := r.extStartTS + uint64(expectedRTPDiff)
|
||||||
|
|
||||||
|
minTS := r.lastSRRTP
|
||||||
|
if r.lastSRNTP == 0 {
|
||||||
|
minTS = uint32(expectedExtRTP)
|
||||||
|
}
|
||||||
r.logger.Debugw(
|
r.logger.Debugw(
|
||||||
"expected RTP timestamp",
|
"expected RTP timestamp",
|
||||||
"firstTime", r.firstTime.String(),
|
"firstTime", r.firstTime.String(),
|
||||||
@@ -817,10 +822,11 @@ func (r *RTPStats) GetExpectedRTPTimestamp(at time.Time) (uint32, uint32, error)
|
|||||||
"expectedRTPDiff", expectedRTPDiff,
|
"expectedRTPDiff", expectedRTPDiff,
|
||||||
"expectedExtRTP", expectedExtRTP,
|
"expectedExtRTP", expectedExtRTP,
|
||||||
"expectedRTP", uint32(expectedExtRTP),
|
"expectedRTP", uint32(expectedExtRTP),
|
||||||
|
"minTS", minTS,
|
||||||
"highestTS", r.highestTS,
|
"highestTS", r.highestTS,
|
||||||
"highestTime", r.highestTime.String(),
|
"highestTime", r.highestTime.String(),
|
||||||
)
|
)
|
||||||
return uint32(expectedExtRTP), r.lastSRRTP, nil
|
return uint32(expectedExtRTP), minTS, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *RTPStats) GetRtcpSenderReport(ssrc uint32) (*rtcp.SenderReport, float64) {
|
func (r *RTPStats) GetRtcpSenderReport(ssrc uint32) (*rtcp.SenderReport, float64) {
|
||||||
|
|||||||
Reference in New Issue
Block a user