avformat/tls_openssl: #if ff_openssl_init/deinit() away if possible

These functions do nothing useful when used with a non-ancient
version of openssl (namely 1.1.0 or above).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2024-05-17 15:09:00 +02:00
parent 8b48b0adab
commit 583c3d45fa
2 changed files with 27 additions and 16 deletions

View file

@ -18,8 +18,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "config.h"
#include "config_components.h"
#if CONFIG_TLS_PROTOCOL && CONFIG_OPENSSL
#include <openssl/opensslv.h>
#endif
#include <fcntl.h>
#include "network.h"
#include "tls.h"
@ -31,7 +36,7 @@
int ff_tls_init(void)
{
#if CONFIG_TLS_PROTOCOL
#if CONFIG_OPENSSL
#if CONFIG_OPENSSL && OPENSSL_VERSION_NUMBER < 0x10100000L
int ret;
if ((ret = ff_openssl_init()) < 0)
return ret;
@ -46,7 +51,7 @@ int ff_tls_init(void)
void ff_tls_deinit(void)
{
#if CONFIG_TLS_PROTOCOL
#if CONFIG_OPENSSL
#if CONFIG_OPENSSL && OPENSSL_VERSION_NUMBER < 0x10100000L
ff_openssl_deinit();
#endif
#if CONFIG_GNUTLS