Fix issues with unaligned atomic operations.
This could be solved by simply reordering the fields, but it is more robust to move the atomics into their own structure, and the extra indirection should not cost much.
This commit is contained in:
@@ -266,12 +266,12 @@ func rtpWriterLoop(writer *rtpWriter, up *rtpUpConnection, track *rtpUpTrack) {
|
||||
track.mu.Lock()
|
||||
ntp := track.srNTPTime
|
||||
rtp := track.srRTPTime
|
||||
cname := track.cname
|
||||
track.mu.Unlock()
|
||||
if ntp != 0 {
|
||||
action.track.SetTimeOffset(ntp, rtp)
|
||||
}
|
||||
if cname != "" {
|
||||
cname, ok := track.cname.Load().(string)
|
||||
if ok && cname != "" {
|
||||
action.track.SetCname(cname)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user