summaryrefslogtreecommitdiff
path: root/libavformat/tls_openssl.c
diff options
context:
space:
mode:
authorJun Zhao <barryjzhao@tencent.com>2019-12-10 17:41:56 +0800
committerJun Zhao <barryjzhao@tencent.com>2019-12-11 14:48:18 +0800
commit4eae85a82f81fa2ff4c317797ca3d82caf35db86 (patch)
treeb4b473ebeadc9602e7048a8b60829aeabbab0548 /libavformat/tls_openssl.c
parente3c732bb0c9bbed9516bfabe0c1ea50d27cbb93f (diff)
downloadffmpeg-4eae85a82f81fa2ff4c317797ca3d82caf35db86.tar.gz
lavf/tls_openssl: support both pre-1.1.0 and post-1.1.0 init
supporting both pre-1.1.0 and post-1.1.0 version of the OpenSSL library as the link: https://wiki.openssl.org/index.php/Library_Initialization Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
Diffstat (limited to 'libavformat/tls_openssl.c')
-rw-r--r--libavformat/tls_openssl.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavformat/tls_openssl.c b/libavformat/tls_openssl.c
index 7ae71bdaf3..53f8363a12 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;