1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-12-22 23:35:46 +01:00

Maintain sender report time in jiffies.

This commit is contained in:
Juliusz Chroboczek 2020-06-03 21:05:03 +02:00
parent 3e305e9827
commit b447a2e9a0

View file

@ -559,7 +559,7 @@ func rtcpUpListener(conn *upConnection, track *upTrack, r *webrtc.RTPReceiver) {
switch p := p.(type) {
case *rtcp.SenderReport:
track.mu.Lock()
track.srTime = rtptime.Now(0x10000)
track.srTime = rtptime.Jiffies()
track.srNTPTime = p.NTPTime
track.srRTPTime = p.RTPTime
track.mu.Unlock()
@ -574,7 +574,7 @@ func sendRR(conn *upConnection) error {
return nil
}
now := rtptime.Now(0x10000)
now := rtptime.Jiffies()
reports := make([]rtcp.ReceptionReport, 0, len(conn.tracks))
for _, t := range conn.tracks {
@ -592,8 +592,9 @@ func sendRR(conn *upConnection) error {
t.mu.Unlock()
var delay uint64
if srNTPTime != 0 {
delay = now - srTime
if srTime != 0 {
delay = (now - srTime) /
(rtptime.JiffiesPerSec / 0x10000)
}
reports = append(reports, rtcp.ReceptionReport{