]> git.sesse.net Git - vlc/blobdiff - src/libvlc-common.c
Privatise some structs and enumerations of PGP update
[vlc] / src / libvlc-common.c
index 76c241d09bdd0322fd5f33feccd12473e73cea65..fdb1d8b531e606b65062ef1cf6d4142152c18d73 100644 (file)
 
 #include <vlc_vlm.h>
 
+#include <assert.h>
+
 /*****************************************************************************
  * The evil global variables. We handle them with care, don't worry.
  *****************************************************************************/
 static libvlc_int_t *    p_static_vlc = NULL;
-static volatile unsigned int i_instances = 0;
+static unsigned          i_instances = 0;
 
 static bool b_daemon = false;
 
@@ -206,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;
 
@@ -279,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 )
     {
@@ -295,7 +301,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
     }
 
     /* Set the config file stuff */
-    p_libvlc->psz_homedir    = config_GetHomeDir();
     priv->psz_configfile = config_GetCustomConfigFile( p_libvlc );
 
     /* Check for plugins cache options */
@@ -923,7 +928,6 @@ int libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
 {
     intf_thread_t      * p_intf = NULL;
     vout_thread_t      * p_vout = NULL;
-    aout_instance_t    * p_aout = NULL;
     libvlc_priv_t      *priv = libvlc_priv (p_libvlc);
 
     /* Ask the interfaces to stop and destroy them */
@@ -946,15 +950,6 @@ int libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
         vout_Destroy( p_vout );
     }
 
-    /* Free audio outputs */
-    msg_Dbg( p_libvlc, "removing all audio outputs" );
-    while( (p_aout = vlc_object_find( p_libvlc, VLC_OBJECT_AOUT, FIND_CHILD )) )
-    {
-        vlc_object_detach( (vlc_object_t *)p_aout );
-        vlc_object_release( (vlc_object_t *)p_aout );
-        aout_Delete( p_aout );
-    }
-
 #ifdef ENABLE_SOUT
     playlist_t         * p_playlist;
     sout_instance_t    * p_sout;
@@ -1065,7 +1060,6 @@ int libvlc_InternalDestroy( libvlc_int_t *p_libvlc, bool b_release )
     /* Free module bank. It is refcounted, so we call this each time  */
     module_EndBank( p_libvlc );
 
-    FREENULL( p_libvlc->psz_homedir );
     FREENULL( priv->psz_configfile );
     var_DelCallback( p_libvlc, "key-pressed", vlc_key_to_action,
                      p_libvlc->p_hotkeys );