# include <dbus/dbus.h>
#endif
+
+#include <vlc_media_library.h>
#include <vlc_playlist.h>
#include <vlc_interface.h>
priv = libvlc_priv (p_libvlc);
priv->p_playlist = NULL;
+ priv->p_ml = NULL;
priv->p_dialog_provider = NULL;
priv->p_vlm = NULL;
/* Initialize mutexes */
vlc_mutex_init( &priv->timer_lock );
+ vlc_ExitInit( &priv->exit );
return p_libvlc;
error:
/* System specific configuration */
system_Configure( p_libvlc, i_argc - vlc_optind, ppsz_argv + vlc_optind );
+#if defined(MEDIA_LIBRARY)
+ /* Get the ML */
+ if( var_GetBool( p_libvlc, "load-media-library-on-startup" ) == true )
+ {
+ priv->p_ml = __ml_Create( VLC_OBJECT( p_libvlc ), NULL );
+ if( !priv->p_ml )
+ {
+ msg_Err( p_libvlc, "ML initialization failed" );
+ return VLC_EGENERIC;
+ }
+ }
+ else
+ {
+ priv->p_ml = NULL;
+ }
+#endif
+
/* Add service discovery modules */
psz_modules = var_InheritString( p_libvlc, "services-discovery" );
if( psz_modules )
/* Free playlist now, all threads are gone */
playlist_Destroy( p_playlist );
+#if defined(MEDIA_LIBRARY)
+ media_library_t* p_ml = priv->p_ml;
+ if( p_ml )
+ {
+ __ml_Destroy( VLC_OBJECT( p_ml ) );
+ vlc_object_release( p_ml );
+ libvlc_priv(p_playlist->p_libvlc)->p_ml = NULL;
+ }
+#endif
+
stats_TimersDumpAll( p_libvlc );
stats_TimersCleanAll( p_libvlc );
msg_Destroy (priv->msg_bank);
/* Destroy mutexes */
+ vlc_ExitDestroy( &priv->exit );
vlc_mutex_destroy( &priv->timer_lock );
#ifndef NDEBUG /* Hack to dump leaked objects tree */
return ret;
}
-#ifndef WIN32
-static vlc_mutex_t exit_lock = VLC_STATIC_MUTEX;
-static vlc_cond_t exiting = VLC_STATIC_COND;
-#else
-extern vlc_mutex_t super_mutex;
-extern vlc_cond_t super_variable;
-# define exit_lock super_mutex
-# define exiting super_variable
-#endif
-
-/**
- * Waits until the LibVLC instance gets an exit signal. Normally, this happens
- * when the user "exits" an interface plugin.
- */
-void libvlc_InternalWait( libvlc_int_t *p_libvlc )
-{
- vlc_mutex_lock( &exit_lock );
- while( vlc_object_alive( p_libvlc ) )
- vlc_cond_wait( &exiting, &exit_lock );
- vlc_mutex_unlock( &exit_lock );
-}
-
-/**
- * Posts an exit signal to LibVLC instance. This will normally initiate the
- * cleanup and destroy process. It should only be called on behalf of the user.
- */
-void libvlc_Quit( libvlc_int_t *p_libvlc )
-{
- vlc_mutex_lock( &exit_lock );
- vlc_object_kill( p_libvlc );
- vlc_cond_broadcast( &exiting );
- vlc_mutex_unlock( &exit_lock );
-}
-
#if defined( ENABLE_NLS ) && (defined (__APPLE__) || defined (WIN32)) && \
( defined( HAVE_GETTEXT ) || defined( HAVE_INCLUDED_GETTEXT ) )
/*****************************************************************************
: !strstr( p_parser->psz_object_name, psz_search ) ) )
{
char *const *pp_shortcuts = p_parser->pp_shortcuts;
- int i;
+ unsigned i;
for( i = 0; i < p_parser->i_shortcuts; i++ )
{
if( b_strict ? !strcmp( psz_search, pp_shortcuts[i] )
if( b_verbose )
{
char *const *pp_shortcuts = p_parser->pp_shortcuts;
- for( int i = 0; i < p_parser->i_shortcuts; i++ )
+ for( unsigned i = 0; i < p_parser->i_shortcuts; i++ )
{
if( strcmp( pp_shortcuts[i], p_parser->psz_object_name ) )
{
return i_width;
}
-
-#include <vlc_avcodec.h>
-
-void vlc_avcodec_mutex (bool acquire)
-{
- static vlc_mutex_t lock = VLC_STATIC_MUTEX;
-
- if (acquire)
- vlc_mutex_lock (&lock);
- else
- vlc_mutex_unlock (&lock);
-}