rtp: using = instead of |= for setting of rtp packet fields

This commit is contained in:
saxon 2018-11-21 12:57:58 +10:30
parent b09a422baa
commit f4d44e0c79
1 changed files with 12 additions and 12 deletions

View File

@ -74,18 +74,18 @@ func (p *Pkt) Bytes() []byte {
const headSize = 3 * 4 // bytes const headSize = 3 * 4 // bytes
buf := make([]byte, headSize, headSize+len(p.Payload)+p.Padding) buf := make([]byte, headSize, headSize+len(p.Payload)+p.Padding)
buf[0] |= p.V<<6 | p.P<<5 | p.CC buf[0] = p.V<<6 | p.P<<5 | p.CC
buf[1] |= p.M<<7 | p.PT buf[1] = p.M<<7 | p.PT
buf[2] |= byte(p.SN >> 8) buf[2] = byte(p.SN >> 8)
buf[3] |= byte(p.SN) buf[3] = byte(p.SN)
buf[4] |= byte(p.TS >> 24) buf[4] = byte(p.TS >> 24)
buf[5] |= byte(p.TS >> 16) buf[5] = byte(p.TS >> 16)
buf[6] |= byte(p.TS >> 8) buf[6] = byte(p.TS >> 8)
buf[7] |= byte(p.TS) buf[7] = byte(p.TS)
buf[8] |= byte(p.SSRC >> 24) buf[8] = byte(p.SSRC >> 24)
buf[9] |= byte(p.SSRC >> 16) buf[9] = byte(p.SSRC >> 16)
buf[10] |= byte(p.SSRC >> 8) buf[10] = byte(p.SSRC >> 8)
buf[11] |= byte(p.SSRC) buf[11] = byte(p.SSRC)
buf = append(buf, p.Payload...) buf = append(buf, p.Payload...)
if p.Padding != 0 { if p.Padding != 0 {