Skip to content

Commit

Permalink
client: prevent UDP listener from closing twice (#515)
Browse files Browse the repository at this point in the history
  • Loading branch information
aler9 authored Jan 31, 2024
1 parent bb139db commit 9cd54f5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
1 change: 1 addition & 0 deletions client_udp_listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion server_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 9cd54f5

Please sign in to comment.