From 8fda40b5447fd150f144f148818dd313e7113ad9 Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Mon, 1 Jun 2020 00:26:23 +0200 Subject: [PATCH] Set delay in receiver report to 0 if no sender report received. --- webclient.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/webclient.go b/webclient.go index b4eb4a5..a552a62 100644 --- a/webclient.go +++ b/webclient.go @@ -585,7 +585,10 @@ func sendRR(conn *upConnection) error { lost = expected - 1 } lastSR := atomic.LoadUint32(&t.lastSenderReport) - delay := now - atomic.LoadUint32(&t.lastSenderReportTime) + var delay uint32 + if lastSR != 0 { + delay = now - atomic.LoadUint32(&t.lastSenderReportTime) + } reports = append(reports, rtcp.ReceptionReport{ SSRC: t.track.SSRC(),