mirror of
https://github.com/aler9/gortsplib
synced 2025-10-16 12:10:48 +08:00
improve performance
This commit is contained in:
@@ -218,10 +218,12 @@ func (st *ServerStream) readerSetInactive(ss *ServerSession) {
|
||||
|
||||
// WritePacketRTP writes a RTP packet to all the readers of the stream.
|
||||
func (st *ServerStream) WritePacketRTP(trackID int, pkt *rtp.Packet, ptsEqualsDTS bool) {
|
||||
byts, err := pkt.Marshal()
|
||||
byts := make([]byte, maxPacketSize)
|
||||
n, err := pkt.MarshalTo(byts)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
byts = byts[:n]
|
||||
|
||||
track := st.stTracks[trackID]
|
||||
now := time.Now()
|
||||
|
Reference in New Issue
Block a user