[FFmpeg-devel] [PATCH] openssl: Support version 1.1.0.

Matt Oliver protogonoi at gmail.com
Sun Oct 9 20:37:38 EEST 2016


On 10 October 2016 at 03:18, Michael Niedermayer <michael at niedermayer.cc>
wrote:

> On Mon, Oct 10, 2016 at 02:39:51AM +1100, Matt Oliver wrote:
> > ---
> >  configure                 |   3 +-
> >  libavformat/tls_openssl.c | 159
> > ++++++++++++++++++++++++++++------------------
> >  2 files changed, 98 insertions(+), 64 deletions(-)
> >
> > diff --git a/configure b/configure
> > index df6ffa2..750684a 100755
> > --- a/configure
> > +++ b/configure
> > @@ -5813,7 +5813,8 @@ enabled omx               && { check_header
> > OMX_Core.h ||
> >                                      add_cflags
> -isystem/opt/vc/include/IL
> > ; }
> >                                  check_header OMX_Core.h ; } ||
> >                                 die "ERROR: OpenMAX IL headers not
> found"; }
> > -enabled openssl           && { use_pkg_config openssl openssl/ssl.h
> > SSL_library_init ||
> > +enabled openssl           && { use_pkg_config openssl openssl/ssl.h
> > OPENSSL_init_ssl ||
> > +                               use_pkg_config openssl openssl/ssl.h
> > SSL_library_init ||
> >                                 check_lib openssl/ssl.h SSL_library_init
> > -lssl -lcrypto ||
> >                                 check_lib openssl/ssl.h SSL_library_init
> > -lssl32 -leay32 ||
> >                                 check_lib openssl/ssl.h SSL_library_init
> > -lssl -lcrypto -lws2_32 -lgdi32 ||
> > diff --git a/libavformat/tls_openssl.c b/libavformat/tls_openssl.c
> > index 46eb3e6..4effb39 100644
> > --- a/libavformat/tls_openssl.c
> > +++ b/libavformat/tls_openssl.c
> > @@ -63,6 +63,85 @@ static unsigned long openssl_thread_id(void)
> >  #endif
> >  #endif
> >
> > +static int url_bio_create(BIO *b)
> > +{
> > +#if OPENSSL_VERSION_NUMBER >= 0x1010000fL
> > +    BIO_set_init(b, 1);
> > +    BIO_set_data(b, NULL);
> > +    BIO_set_flags(b, 0);
> > +#else
> > +    b->init = 1;
> > +    b->ptr = NULL;
> > +    b->flags = 0;
> > +#endif
> > +    return 1;
> > +}
> > +
> > +static int url_bio_destroy(BIO *b)
> > +{
> > +    return 1;
> > +}
> > +
>
> > +#if OPENSSL_VERSION_NUMBER >= 0x1010000fL
> > +#define BIO_GET_DATA(x) BIO_get_data(x);
> > +#else
> > +#define BIO_GET_DATA(x) x->ptr;
> > +#endif
>
> this needs a () for protecting x
>

Fixed locally.


> also there are these new warnings:
>
> libavformat/tls_openssl.c: In function ‘url_bio_bread’:
> libavformat/tls_openssl.c:94:5: warning: ISO C90 forbids mixed
> declarations and code [-Wdeclaration-after-statement]
> libavformat/tls_openssl.c: In function ‘url_bio_bwrite’:
> libavformat/tls_openssl.c:106:5: warning: ISO C90 forbids mixed
> declarations and code [-Wdeclaration-after-statement]
>

I assume the above was with 1.1.0 (as prior versions result in identical
code to what was there). Ive locally modified both functions so that
URLContext *h is only declared before ret but initialised in a new line
added after ret.


More information about the ffmpeg-devel mailing list