mirror of
https://github.com/aler9/gortsplib
synced 2025-09-27 03:25:52 +08:00
client: prevent UDP listener from closing twice (#515)
This commit is contained in:
@@ -1886,7 +1886,7 @@ func (c *Client) PacketPTS(medi *description.Media, pkt *rtp.Packet) (time.Durat
|
||||
}
|
||||
|
||||
// PacketNTP returns the NTP timestamp of an incoming RTP packet.
|
||||
// The NTP timestamp is computed from sender reports.
|
||||
// The NTP timestamp is computed from RTCP sender reports.
|
||||
func (c *Client) PacketNTP(medi *description.Media, pkt *rtp.Packet) (time.Time, bool) {
|
||||
cm := c.medias[medi]
|
||||
ct := cm.formats[pkt.PayloadType]
|
||||
|
@@ -136,6 +136,7 @@ func (u *clientUDPListener) start() {
|
||||
func (u *clientUDPListener) stop() {
|
||||
u.pc.SetReadDeadline(time.Now())
|
||||
<-u.done
|
||||
u.running = false
|
||||
}
|
||||
|
||||
func (u *clientUDPListener) run() {
|
||||
|
@@ -1250,7 +1250,7 @@ func (ss *ServerSession) PacketPTS(medi *description.Media, pkt *rtp.Packet) (ti
|
||||
}
|
||||
|
||||
// PacketNTP returns the NTP timestamp of an incoming RTP packet.
|
||||
// The NTP timestamp is computed from sender reports.
|
||||
// The NTP timestamp is computed from RTCP sender reports.
|
||||
func (ss *ServerSession) PacketNTP(medi *description.Media, pkt *rtp.Packet) (time.Time, bool) {
|
||||
sm := ss.setuppedMedias[medi]
|
||||
sf := sm.formats[pkt.PayloadType]
|
||||
|
Reference in New Issue
Block a user