From d7bc024476397970c48ffaca4bbef614322a9666 Mon Sep 17 00:00:00 2001 From: Jack Lau Date: Mon, 4 Aug 2025 15:49:11 +0800 Subject: [PATCH] avformat/tls_openssl: simplify the external_sock check Signed-off-by: Jack Lau --- libavformat/tls_openssl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/tls_openssl.c b/libavformat/tls_openssl.c index d6d8afd96b..3df6e3f0a1 100644 --- a/libavformat/tls_openssl.c +++ b/libavformat/tls_openssl.c @@ -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) {