client: prevent UDP listener from closing twice (#515)

This commit is contained in:
Alessandro Ros
2024-01-31 22:10:31 +01:00
committed by GitHub
parent bb139dbd4a
commit 9cd54f56b4
3 changed files with 3 additions and 2 deletions

View File

@@ -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]

View File

@@ -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() {

View File

@@ -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]