[vlc-devel] commit: libvlccore: Don't attempt to use vlc_thread_set_priority() before the config are initialized. (Pierre d'Herbemont )

git version control git at videolan.org
Wed May 28 00:42:00 CEST 2008


vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Wed May 28 00:42:37 2008 +0200| [e9b987f4ad35218b3ca51336fd138facc9e5e335]

libvlccore: Don't attempt to use vlc_thread_set_priority() before the config are initialized.

This fixes a crash on Mac OS X.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e9b987f4ad35218b3ca51336fd138facc9e5e335
---

 src/libvlc-common.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/libvlc-common.c b/src/libvlc-common.c
index ddee077..fdb1d8b 100644
--- a/src/libvlc-common.c
+++ b/src/libvlc-common.c
@@ -208,9 +208,7 @@ libvlc_int_t * libvlc_InternalCreate( void )
     /* Initialize mutexes */
     vlc_mutex_init( &priv->timer_lock );
     vlc_mutex_init( &priv->config_lock );
-#ifdef __APPLE__
-    vlc_thread_set_priority( p_libvlc, VLC_THREAD_PRIORITY_LOW );
-#endif
+
     /* Store data for the non-reentrant API */
     p_static_vlc = p_libvlc;
 
@@ -281,6 +279,12 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
         return VLC_EGENERIC;
     }
 
+#ifdef __APPLE__
+    /* vlc_thread_set_priority needs to query the config,
+     * so this is the earliest moment where we can set this */
+    vlc_thread_set_priority( p_libvlc, VLC_THREAD_PRIORITY_LOW );
+#endif
+
     /* Check for short help option */
     if( config_GetInt( p_libvlc, "help" ) > 0 )
     {




More information about the vlc-devel mailing list