Changeset b0f459734980ed8bc36fd968587c64f77c72aa4b

Show
Ignore:
Timestamp:
05/17/07 19:03:56 (1 year ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1179421436 +0000
git-parent:

[04d05b50633957945de3cbbf955e67cfb5905a65]

git-author:
Rémi Denis-Courmont <rem@videolan.org> 1179421436 +0000
Message:

Fix initialization

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • libs/srtp/Makefile.am

    r10ee356 rb0f4597  
    3737srtp_LDADD = libvlc_srtp.la 
    3838 
     39lcov-run: 
     40    rm -f *.gcda lcov 
     41    $(MAKE) $(AM_MAKEFLAGS) check 
     42 
     43lcov-pre.out: 
     44    lcov -c -d . -o lcov.tmp 
     45 
     46lcov.out: lcov-pre.out 
     47    lcov -r lcov.tmp '*test*' > lcov.out 
     48 
     49lcov: lcov.out 
     50    genhtml lcov.out -o lcov 
     51 
     52.PHONY: lcov-run 
  • libs/srtp/srtp.c

    r7bdd4ba rb0f4597  
    9191static void initonce_libgcrypt (void) 
    9292{ 
     93#ifndef WIN32 
     94    gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread); 
     95#endif 
     96 
    9397    if ((gcry_check_version ("1.1.94") == NULL) 
    9498     || gcry_control (GCRYCTL_DISABLE_SECMEM, 0) 
    95      || gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0) 
    96 #ifndef WIN32 
    97      || gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread) 
    98 #endif 
    99        ) 
     99     || gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0)) 
    100100        return; 
    101101 
     
    112112    pthread_mutex_lock (&mutex); 
    113113    pthread_once (&once, initonce_libgcrypt); 
    114     retval = -libgcrypt_usable; 
    115     pthread_mutex_unlock (&mutex); 
    116114#else 
    117115# warning FIXME: This is not thread-safe. 
    118116    if (!libgcrypt_usable) 
    119117        initonce_libgcrypt (); 
    120     retval = -libgcrypt_usable; 
     118#endif 
     119 
     120    retval = libgcrypt_usable ? 0 : -1; 
     121 
     122#ifndef WIN32 
     123    pthread_mutex_unlock (&mutex); 
    121124#endif 
    122125