This reverts commit 7ab6e5df09.
This commit is contained in:
@@ -630,24 +630,17 @@ func (r *RTPStatsSender) GetRtcpSenderReport(ssrc uint32, publisherSRData *livek
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
timeSincePublisherSRAdjusted := time.Since(time.Unix(0, publisherSRData.AtAdjusted))
|
||||||
|
now := publisherSRData.AtAdjusted + timeSincePublisherSRAdjusted.Nanoseconds()
|
||||||
var (
|
var (
|
||||||
reportTime int64
|
|
||||||
reportTimeAdjusted int64
|
|
||||||
nowNTP mediatransportutil.NtpTime
|
nowNTP mediatransportutil.NtpTime
|
||||||
nowRTPExt uint64
|
nowRTPExt uint64
|
||||||
)
|
)
|
||||||
if passThrough {
|
if passThrough {
|
||||||
reportTime = publisherSRData.At
|
|
||||||
reportTimeAdjusted = publisherSRData.AtAdjusted
|
|
||||||
|
|
||||||
nowNTP = mediatransportutil.NtpTime(publisherSRData.NtpTimestamp)
|
nowNTP = mediatransportutil.NtpTime(publisherSRData.NtpTimestamp)
|
||||||
nowRTPExt = publisherSRData.RtpTimestampExt - tsOffset
|
nowRTPExt = publisherSRData.RtpTimestampExt - tsOffset
|
||||||
} else {
|
} else {
|
||||||
timeSincePublisherSRAdjusted := time.Since(time.Unix(0, publisherSRData.AtAdjusted))
|
nowNTP = mediatransportutil.ToNtpTime(time.Unix(0, now))
|
||||||
reportTimeAdjusted = publisherSRData.AtAdjusted + timeSincePublisherSRAdjusted.Nanoseconds()
|
|
||||||
reportTime = reportTimeAdjusted
|
|
||||||
|
|
||||||
nowNTP = mediatransportutil.ToNtpTime(time.Unix(0, reportTime))
|
|
||||||
nowRTPExt = publisherSRData.RtpTimestampExt - tsOffset + uint64(timeSincePublisherSRAdjusted.Nanoseconds()*int64(r.params.ClockRate)/1e9)
|
nowRTPExt = publisherSRData.RtpTimestampExt - tsOffset + uint64(timeSincePublisherSRAdjusted.Nanoseconds()*int64(r.params.ClockRate)/1e9)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -657,8 +650,8 @@ func (r *RTPStatsSender) GetRtcpSenderReport(ssrc uint32, publisherSRData *livek
|
|||||||
NtpTimestamp: uint64(nowNTP),
|
NtpTimestamp: uint64(nowNTP),
|
||||||
RtpTimestamp: uint32(nowRTPExt),
|
RtpTimestamp: uint32(nowRTPExt),
|
||||||
RtpTimestampExt: nowRTPExt,
|
RtpTimestampExt: nowRTPExt,
|
||||||
At: reportTime,
|
At: now,
|
||||||
AtAdjusted: reportTimeAdjusted,
|
AtAdjusted: now,
|
||||||
Packets: packetCount,
|
Packets: packetCount,
|
||||||
Octets: octetCount,
|
Octets: octetCount,
|
||||||
}
|
}
|
||||||
@@ -668,11 +661,10 @@ func (r *RTPStatsSender) GetRtcpSenderReport(ssrc uint32, publisherSRData *livek
|
|||||||
"feed", WrappedRTCPSenderReportStateLogger{publisherSRData},
|
"feed", WrappedRTCPSenderReportStateLogger{publisherSRData},
|
||||||
"tsOffset", tsOffset,
|
"tsOffset", tsOffset,
|
||||||
"timeNow", time.Now(),
|
"timeNow", time.Now(),
|
||||||
"reportTime", time.Unix(0, reportTime),
|
"now", time.Unix(0, now),
|
||||||
"reportTimeAdjusted", time.Unix(0, reportTimeAdjusted),
|
"timeSinceHighest", time.Duration(now-r.highestTime),
|
||||||
"timeSinceHighest", time.Since(time.Unix(0, r.highestTime)),
|
"timeSinceFirst", time.Duration(now-r.firstTime),
|
||||||
"timeSinceFirst", time.Since(time.Unix(0, r.firstTime)),
|
"timeSincePublisherSRAdjusted", timeSincePublisherSRAdjusted,
|
||||||
"timeSincePublisherSRAdjusted", time.Since(time.Unix(0, publisherSRData.AtAdjusted)),
|
|
||||||
"timeSincePublisherSR", time.Since(time.Unix(0, publisherSRData.At)),
|
"timeSincePublisherSR", time.Since(time.Unix(0, publisherSRData.At)),
|
||||||
"nowRTPExt", nowRTPExt,
|
"nowRTPExt", nowRTPExt,
|
||||||
"rtpStats", lockedRTPStatsSenderLogEncoder{r},
|
"rtpStats", lockedRTPStatsSenderLogEncoder{r},
|
||||||
|
|||||||
Reference in New Issue
Block a user