client: support reading from servers that use random UDP ports (https://github.com/aler9/rtsp-simple-server/issues/691)

This commit is contained in:
aler9
2021-11-13 10:13:54 +01:00
parent d205c00878
commit ba7f9aff25
3 changed files with 11 additions and 5 deletions

View File

@@ -1425,7 +1425,7 @@ func (c *Client) doSetup(
rtpListener.remoteReadIP = c.nconn.RemoteAddr().(*net.TCPAddr).IP
rtpListener.remoteWriteIP = c.nconn.RemoteAddr().(*net.TCPAddr).IP
rtpListener.remoteZone = c.nconn.RemoteAddr().(*net.TCPAddr).Zone
if thRes.ServerPorts != nil {
if !c.AnyPortEnable {
rtpListener.remotePort = thRes.ServerPorts[0]
}
rtpListener.trackID = trackID
@@ -1435,7 +1435,7 @@ func (c *Client) doSetup(
rtcpListener.remoteReadIP = c.nconn.RemoteAddr().(*net.TCPAddr).IP
rtcpListener.remoteWriteIP = c.nconn.RemoteAddr().(*net.TCPAddr).IP
rtcpListener.remoteZone = c.nconn.RemoteAddr().(*net.TCPAddr).Zone
if thRes.ServerPorts != nil {
if !c.AnyPortEnable {
rtcpListener.remotePort = thRes.ServerPorts[1]
}
rtcpListener.trackID = trackID