1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-10 06:10:52 +02:00

avformat/tls_openssl: simplify the external_sock check

Signed-off-by: Jack Lau <jacklau1222@qq.com>
This commit is contained in:
Jack Lau
2025-08-04 15:49:11 +08:00
committed by Timo Rothenpieler
parent 553fa9e3df
commit d7bc024476

View File

@@ -872,7 +872,7 @@ static int dtls_start(URLContext *h, const char *url, int flags, AVDictionary **
DTLS_set_link_mtu(c->ssl, s->mtu);
init_bio_method(h);
if (c->tls_shared.external_sock != 1) {
if (!c->tls_shared.external_sock) {
if ((ret = ff_tls_open_underlying(&c->tls_shared, h, url, options)) < 0) {
av_log(c, AV_LOG_ERROR, "Failed to connect %s\n", url);
return ret;
@@ -896,7 +896,7 @@ static int dtls_start(URLContext *h, const char *url, int flags, AVDictionary **
*
* The SSL_do_handshake can't be called if DTLS hasn't prepare for udp.
*/
if (c->tls_shared.external_sock != 1) {
if (!c->tls_shared.external_sock) {
ret = dtls_handshake(h);
// Fatal SSL error, for example, no available suite when peer is DTLS 1.0 while we are DTLS 1.2.
if (ret < 0) {