mirror of
https://github.com/jech/galene.git
synced 2024-11-22 16:45:58 +01:00
Maintain sender report time in jiffies.
This commit is contained in:
parent
3e305e9827
commit
b447a2e9a0
1 changed files with 5 additions and 4 deletions
|
@ -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 {
|
||||||
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 {
|
||||||
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{
|
||||||
|
|
Loading…
Reference in a new issue