On Thu, 24 Nov 2016, Diego Biurrun wrote:

On Wed, Nov 23, 2016 at 11:35:08PM +0200, Martin Storsjö wrote:
The rtmpdh code can use crypto libraries which may require
a process global init. (gcrypt is one of the libraries
where the rtmpdh test code can fail if global init hasn't been
done, depending on gcrypt version.)
---
 libavformat/tests/rtmpdh.c | 2 ++
 1 file changed, 2 insertions(+)

As you predicted, this does not fail my particular test case.

does not fix, I presume

To fix that, you could just as an experiment try this:

diff --git a/libavformat/tls_gnutls.c b/libavformat/tls_gnutls.c
index 3e29a45..abc9e69 100644
--- a/libavformat/tls_gnutls.c
+++ b/libavformat/tls_gnutls.c
@@ -35,7 +35,8 @@
 #include "libavutil/opt.h"
 #include "libavutil/parseutils.h"

-#if HAVE_THREADS && GNUTLS_VERSION_NUMBER <= 0x020b00
+#if CONFIG_GCRYPT
 #include <gcrypt.h>
 #include "libavutil/thread.h"
 GCRY_THREAD_OPTION_PTHREAD_IMPL;
@@ -52,10 +53,10 @@ typedef struct TLSContext {
 void ff_gnutls_init(void)
 {
     avpriv_lock_avformat();
-#if HAVE_THREADS && GNUTLS_VERSION_NUMBER < 0x020b00
+#if CONFIG_GCRYPT
     if (gcry_control(GCRYCTL_ANY_INITIALIZATION_P) == 0)
         gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
#endif
     gnutls_global_init();
     avpriv_unlock_avformat();
 }


But I'm quite ok with dropping gcrypt support altogether.


--- a/libavformat/tests/rtmpdh.c
+++ b/libavformat/tests/rtmpdh.c
@@ -17,6 +17,7 @@

 #include "libavformat/rtmpdh.c"
+#include "libavformat/avformat.h"

nit: order

Fixed

@@ -150,6 +151,7 @@ fail:

 int main(void)
 {
+    avformat_network_init();
     if (test_random_shared_secret() < 0)
         return 1;
     if (test_ref_data() < 0)

LGTM

Pushed to master

Please push to the 12 branch as well.

Will try to remember to do that later, I'm short on time right now. Or feel free to do that for me if you beat me to it.

// Martin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to