server: allow calling ServerSession.WritePacketRTCP() inside OnRecord and OnPlay (#99)

This commit is contained in:
aler9
2022-02-18 23:19:33 +01:00
parent cbc228acbf
commit 86fb4181c7
4 changed files with 109 additions and 41 deletions

View File

@@ -224,10 +224,8 @@ func (st *ServerStream) WritePacketRTP(trackID int, pkt *rtp.Packet) {
atomic.StoreUint32(&track.lastSequenceNumber,
uint32(pkt.Header.SequenceNumber))
atomic.StoreUint32(&track.lastTimeRTP, pkt.Header.Timestamp)
atomic.StoreInt64(&track.lastTimeNTP, time.Now().Unix())
atomic.StoreUint32(&track.lastSSRC, pkt.Header.SSRC)
st.mutex.RLock()