remove useless check (#849)

This commit is contained in:
Alessandro Ros
2025-08-07 16:31:12 +02:00
committed by GitHub
parent 6d6c7fe273
commit 5cbe14c918

View File

@@ -1586,10 +1586,6 @@ func (c *Client) doSetup(
transport = *c.effectiveTransport
th.Secure = c.effectiveSecure
if th.Secure && !medi.Secure {
return nil, fmt.Errorf("previous media was setupped securely but current cannot")
}
// use transport from config, secure flag from server
case c.Transport != nil:
transport = *c.Transport
@@ -1618,9 +1614,9 @@ func (c *Client) doSetup(
switch transport {
case TransportUDP, TransportUDPMulticast:
if c.Scheme == "rtsps" && !medi.Secure {
if c.Scheme == "rtsps" && !th.Secure {
cm.close()
return nil, fmt.Errorf("server does not support secure UDP")
return nil, fmt.Errorf("unable to setup secure UDP")
}
th.Protocol = headers.TransportProtocolUDP