patch-libavformat_tls_openssl_c 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. https://raw.githubusercontent.com/gentoo/libressl/master/media-video/ffmpeg/files/ffmpeg-3.3-libressl.patch
  2. --- ffmpeg-3.4.1.orig/libavformat/tls_openssl.c 2017-12-10 22:35:10.000000000 +0100
  3. +++ ffmpeg-3.4.1/libavformat/tls_openssl.c 2018-02-12 18:03:02.844775701 +0100
  4. @@ -43,7 +43,7 @@ typedef struct TLSContext {
  5. TLSShared tls_shared;
  6. SSL_CTX *ctx;
  7. SSL *ssl;
  8. -#if OPENSSL_VERSION_NUMBER >= 0x1010000fL
  9. +#if OPENSSL_VERSION_NUMBER >= 0x1010000fL && !defined(LIBRESSL_VERSION_NUMBER)
  10. BIO_METHOD* url_bio_method;
  11. #endif
  12. } TLSContext;
  13. @@ -68,7 +68,7 @@ static unsigned long openssl_thread_id(v
  14. static int url_bio_create(BIO *b)
  15. {
  16. -#if OPENSSL_VERSION_NUMBER >= 0x1010000fL
  17. +#if OPENSSL_VERSION_NUMBER >= 0x1010000fL && !defined(LIBRESSL_VERSION_NUMBER)
  18. BIO_set_init(b, 1);
  19. BIO_set_data(b, NULL);
  20. BIO_set_flags(b, 0);
  21. @@ -85,7 +85,7 @@ static int url_bio_destroy(BIO *b)
  22. return 1;
  23. }
  24. -#if OPENSSL_VERSION_NUMBER >= 0x1010000fL
  25. +#if OPENSSL_VERSION_NUMBER >= 0x1010000fL && !defined(LIBRESSL_VERSION_NUMBER)
  26. #define GET_BIO_DATA(x) BIO_get_data(x)
  27. #else
  28. #define GET_BIO_DATA(x) (x)->ptr
  29. @@ -129,7 +129,7 @@ static int url_bio_bputs(BIO *b, const c
  30. return url_bio_bwrite(b, str, strlen(str));
  31. }
  32. -#if OPENSSL_VERSION_NUMBER < 0x1010000fL
  33. +#if OPENSSL_VERSION_NUMBER < 0x1010000fL || defined(LIBRESSL_VERSION_NUMBER)
  34. static BIO_METHOD url_bio_method = {
  35. .type = BIO_TYPE_SOURCE_SINK,
  36. .name = "urlprotocol bio",
  37. @@ -208,7 +208,7 @@ static int tls_close(URLContext *h)
  38. SSL_CTX_free(c->ctx);
  39. if (c->tls_shared.tcp)
  40. ffurl_close(c->tls_shared.tcp);
  41. -#if OPENSSL_VERSION_NUMBER >= 0x1010000fL
  42. +#if OPENSSL_VERSION_NUMBER >= 0x1010000fL && !defined(LIBRESSL_VERSION_NUMBER)
  43. if (c->url_bio_method)
  44. BIO_meth_free(c->url_bio_method);
  45. #endif
  46. @@ -266,7 +266,7 @@ static int tls_open(URLContext *h, const
  47. ret = AVERROR(EIO);
  48. goto fail;
  49. }
  50. -#if OPENSSL_VERSION_NUMBER >= 0x1010000fL
  51. +#if OPENSSL_VERSION_NUMBER >= 0x1010000fL && !defined(LIBRESSL_VERSION_NUMBER)
  52. p->url_bio_method = BIO_meth_new(BIO_TYPE_SOURCE_SINK, "urlprotocol bio");
  53. BIO_meth_set_write(p->url_bio_method, url_bio_bwrite);
  54. BIO_meth_set_read(p->url_bio_method, url_bio_bread);