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:
Juliusz Chroboczek
2020-12-27 01:24:52 +01:00
parent e88942c9a9
commit 9e4aede72a
4 changed files with 78 additions and 49 deletions
+2 -2
View File
@@ -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)
}