X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Ftls_openssl.c;h=53f8363a12aa82f6b4006d43b4a4ef8a64f5a845;hb=632b8298b70969f6ab43509fd276b33295d9e336;hp=59a86150a793dbc18c34f56578f6839c8fd7fb1a;hpb=5c1aafff2d844b177b0b20db4a38d8460992558b;p=ffmpeg diff --git a/libavformat/tls_openssl.c b/libavformat/tls_openssl.c index 59a86150a79..53f8363a12a 100644 --- a/libavformat/tls_openssl.c +++ b/libavformat/tls_openssl.c @@ -70,8 +70,15 @@ int ff_openssl_init(void) { ff_lock_avformat(); if (!openssl_init) { + /* OpenSSL 1.0.2 or below, then you would use SSL_library_init. If you are + * using OpenSSL 1.1.0 or above, then the library will initialize + * itself automatically. + * https://wiki.openssl.org/index.php/Library_Initialization + */ +#if OPENSSL_VERSION_NUMBER < 0x10100000L SSL_library_init(); SSL_load_error_strings(); +#endif #if HAVE_THREADS if (!CRYPTO_get_locking_callback()) { int i; @@ -119,7 +126,7 @@ static int print_tls_error(URLContext *h, int ret) TLSContext *c = h->priv_data; if (h->flags & AVIO_FLAG_NONBLOCK) { int err = SSL_get_error(c->ssl, ret); - if (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_READ) + if (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE) return AVERROR(EAGAIN); } av_log(h, AV_LOG_ERROR, "%s\n", ERR_error_string(ERR_get_error(), NULL));