Commit b447a2e9 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Maintain sender report time in jiffies.

parent 3e305e98
...@@ -559,7 +559,7 @@ func rtcpUpListener(conn *upConnection, track *upTrack, r *webrtc.RTPReceiver) { ...@@ -559,7 +559,7 @@ func rtcpUpListener(conn *upConnection, track *upTrack, r *webrtc.RTPReceiver) {
switch p := p.(type) { switch p := p.(type) {
case *rtcp.SenderReport: case *rtcp.SenderReport:
track.mu.Lock() track.mu.Lock()
track.srTime = rtptime.Now(0x10000) track.srTime = rtptime.Jiffies()
track.srNTPTime = p.NTPTime track.srNTPTime = p.NTPTime
track.srRTPTime = p.RTPTime track.srRTPTime = p.RTPTime
track.mu.Unlock() track.mu.Unlock()
...@@ -574,7 +574,7 @@ func sendRR(conn *upConnection) error { ...@@ -574,7 +574,7 @@ func sendRR(conn *upConnection) error {
return nil return nil
} }
now := rtptime.Now(0x10000) now := rtptime.Jiffies()
reports := make([]rtcp.ReceptionReport, 0, len(conn.tracks)) reports := make([]rtcp.ReceptionReport, 0, len(conn.tracks))
for _, t := range conn.tracks { for _, t := range conn.tracks {
...@@ -592,8 +592,9 @@ func sendRR(conn *upConnection) error { ...@@ -592,8 +592,9 @@ func sendRR(conn *upConnection) error {
t.mu.Unlock() t.mu.Unlock()
var delay uint64 var delay uint64
if srNTPTime != 0 { if srTime != 0 {
delay = now - srTime delay = (now - srTime) /
(rtptime.JiffiesPerSec / 0x10000)
} }
reports = append(reports, rtcp.ReceptionReport{ reports = append(reports, rtcp.ReceptionReport{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment