[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 
violation.

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:

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

Someone could make a patch from this to add it to
contrib/src/pthreads/pthreads-win64.patch
as i dont know how to do that.

Regards,
Mario



More information about the vlc-devel mailing list