mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 07:06:58 +08:00
server: wait for a packet with DTS equal to PTS before filling RTP-Info
This commit is contained in:
@@ -13,9 +13,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type serverStreamTrack struct {
|
type serverStreamTrack struct {
|
||||||
firstPacketSent bool
|
|
||||||
lastSequenceNumber uint16
|
lastSequenceNumber uint16
|
||||||
lastSSRC uint32
|
lastSSRC uint32
|
||||||
|
lastTimeFilled bool
|
||||||
lastTimeRTP uint32
|
lastTimeRTP uint32
|
||||||
lastTimeNTP time.Time
|
lastTimeNTP time.Time
|
||||||
rtcpSender *rtcpsender.RTCPSender
|
rtcpSender *rtcpsender.RTCPSender
|
||||||
@@ -96,7 +96,7 @@ func (st *ServerStream) rtpInfo(trackID int, now time.Time) (uint16, uint32, boo
|
|||||||
|
|
||||||
track := st.streamTracks[trackID]
|
track := st.streamTracks[trackID]
|
||||||
|
|
||||||
if !track.firstPacketSent {
|
if !track.lastTimeFilled {
|
||||||
return 0, 0, false
|
return 0, 0, false
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -253,8 +253,8 @@ func (st *ServerStream) WritePacketRTP(trackID int, pkt *rtp.Packet, ptsEqualsDT
|
|||||||
track := st.streamTracks[trackID]
|
track := st.streamTracks[trackID]
|
||||||
now := time.Now()
|
now := time.Now()
|
||||||
|
|
||||||
if !track.firstPacketSent || ptsEqualsDTS {
|
if ptsEqualsDTS {
|
||||||
track.firstPacketSent = true
|
track.lastTimeFilled = true
|
||||||
track.lastTimeRTP = pkt.Header.Timestamp
|
track.lastTimeRTP = pkt.Header.Timestamp
|
||||||
track.lastTimeNTP = now
|
track.lastTimeNTP = now
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user