[vlc-devel] zvbi on win64

Mario Speiß 1034-135 at online.de
Sat Jan 19 19:06:56 CET 2013

The zvbi for teletext of the win64 builds crashes due to segmentation 

I found out that this s.v. is caused from ptw32_mcs_lock_release() from 
pthread_once() using an uninitialized function pointer 
(ptw32_interlocked_compare_exchange alias its #define).

If pthreads are used as DLL that function pointer is initialized (either 
to use windows api or if not working, then pthreads implementation - 
ptw32_InterlockedCompareExchange() - is used). However, i was not able 
to use the attach/detach-methods of pthreads directly so i added the 
following code to pthread_once.c (line 49 and following) to let pthreads 
use its own implementation and to not crash vlc:

pthread_once (pthread_once_t * once_control, void (*init_routine) (void))
+#ifdef WIN64
+  if (ptw32_interlocked_compare_exchange == NULL)
+    {
+      ptw32_interlocked_compare_exchange = 
+    }
   if (once_control == NULL || init_routine == NULL)
       return EINVAL;

Someone could make a patch from this to add it to
as i dont know how to do that.


More information about the vlc-devel mailing list