Make duration functions work with negative values.

This commit is contained in:
Juliusz Chroboczek
2022-04-15 03:35:34 +02:00
parent d36111d9f9
commit 99055e5cae
5 changed files with 32 additions and 13 deletions
+1 -1
View File
@@ -57,7 +57,7 @@ func (c *webClient) GetStats() *stats.Client {
maxTid := layer.maxTid
rate, _ := t.rate.Estimate()
maxRate, _, _ := t.GetMaxBitrate()
rtt := rtptime.ToDuration(t.getRTT(),
rtt := rtptime.ToDuration(int64(t.getRTT()),
rtptime.JiffiesPerSec)
loss, jitter := t.stats.Get(jiffies)
j := time.Duration(jitter) * time.Second /
+1 -1
View File
@@ -138,7 +138,7 @@ func (wp *rtpWriterPool) write(seqno uint16, index uint16, delay uint32, isvideo
// audio, try again with a delay
d := delay / uint32(2*len(wp.writers))
timer := time.NewTimer(rtptime.ToDuration(
uint64(d), rtptime.JiffiesPerSec,
int64(d), rtptime.JiffiesPerSec,
))
select {