[vlc-commits] [Git][videolan/vlc][master] x264: remove pthreadGC2 code

Steve Lhomme (@robUx4) gitlab at videolan.org
Wed Sep 15 09:59:35 UTC 2021



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
7be0b052 by Steve Lhomme at 2021-09-15T09:33:40+00:00
x264: remove pthreadGC2 code

We no longer use/support it in 4.0

- - - - -


1 changed file:

- modules/codec/x264.c


Changes:

=====================================
modules/codec/x264.c
=====================================
@@ -37,9 +37,6 @@
 #include <vlc_cpu.h>
 #include <math.h>
 
-#if defined(PTW32_STATIC_LIB) && defined(HAVE_PTHREAD_H)
-#include <pthread.h>
-#endif
 #ifdef PLUGIN_X262
 #include <x262.h>
 #else
@@ -755,11 +752,6 @@ typedef struct
     uint8_t         *p_sei;
 } encoder_sys_t;
 
-#ifdef PTW32_STATIC_LIB
-static vlc_mutex_t pthread_win32_mutex = VLC_STATIC_MUTEX;
-static int pthread_win32_count = 0;
-#endif
-
 /*****************************************************************************
  * Open: probe the encoder
  *****************************************************************************/
@@ -1330,26 +1322,6 @@ static int  Open ( vlc_object_t *p_this )
 
     p_sys->param.pf_log = x264_log;
     p_sys->param.p_log_private = p_enc;
-    /* We need to initialize pthreadw32 before we open the encoder,
-       but only once for the whole application. Since pthreadw32
-       doesn't keep a refcount, do it ourselves. */
-#ifdef PTW32_STATIC_LIB
-    vlc_mutex_lock( &pthread_win32_mutex );
-
-    if( pthread_win32_count == 0 )
-    {
-        msg_Dbg( p_enc, "initializing pthread-win32" );
-        if( !pthread_win32_process_attach_np() || !pthread_win32_thread_attach_np() )
-        {
-            msg_Warn( p_enc, "pthread Win32 Initialization failed" );
-            vlc_mutex_unlock( &pthread_win32_mutex );
-            return VLC_EGENERIC;
-        }
-    }
-
-    pthread_win32_count++;
-    vlc_mutex_unlock( &pthread_win32_mutex );
-#endif
 
     i_val = var_GetInteger( p_enc, SOUT_CFG_PREFIX "lookahead" );
     if( i_val != 40 )
@@ -1551,18 +1523,4 @@ static void Close( vlc_object_t *p_this )
         msg_Dbg( p_enc, "framecount still in libx264 buffer: %d", x264_encoder_delayed_frames( p_sys->h ) );
         x264_encoder_close( p_sys->h );
     }
-
-#ifdef PTW32_STATIC_LIB
-    vlc_mutex_lock( &pthread_win32_mutex );
-    pthread_win32_count--;
-
-    if( pthread_win32_count == 0 )
-    {
-        pthread_win32_thread_detach_np();
-        pthread_win32_process_detach_np();
-        msg_Dbg( p_enc, "pthread-win32 deinitialized" );
-    }
-
-    vlc_mutex_unlock( &pthread_win32_mutex );
-#endif
 }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/7be0b05287b0cfab69d884200e4348a8c847a0b3

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/7be0b05287b0cfab69d884200e4348a8c847a0b3
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list