From af462329ab1ea6f5897974cd62e0700b6f18dba6 Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Sun, 27 Mar 2022 23:32:25 +0200 Subject: [PATCH] Set time offsets and cname as soon as possible. --- rtpconn/rtpconn.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rtpconn/rtpconn.go b/rtpconn/rtpconn.go index ec29355..fbb8660 100644 --- a/rtpconn/rtpconn.go +++ b/rtpconn/rtpconn.go @@ -449,6 +449,13 @@ func (up *rtpUpTrack) AddLocal(local conn.DownTrack) error { return nil } } + if up.srNTPTime != 0 { + local.SetTimeOffset(up.srNTPTime, up.srRTPTime) + } + cname, ok := up.cname.Load().(string) + if ok && cname != "" { + local.SetCname(cname) + } up.local = append(up.local, local) up.mu.Unlock()