X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Flibvlc.c;h=efd4952445624efa3436cd354c03e98b3b4df537;hb=e0600d460ae60e32b189b79ed61c9dc217577af2;hp=8690ee2a1c28d4e4cc9ef8e190b9a5ebb37968c7;hpb=0b574db7fddd22289bedd007e6b382f92f96ea31;p=vlc diff --git a/src/libvlc.c b/src/libvlc.c index 8690ee2a1c..efd4952445 100644 --- a/src/libvlc.c +++ b/src/libvlc.c @@ -273,6 +273,7 @@ libvlc_int_t * libvlc_InternalCreate( void ) /* Initialize mutexes */ vlc_mutex_init( &priv->timer_lock ); + vlc_ExitInit( &priv->exit ); return p_libvlc; error: @@ -1073,6 +1074,7 @@ void libvlc_InternalDestroy( libvlc_int_t *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 */ @@ -1121,40 +1123,6 @@ int libvlc_InternalAddIntf( libvlc_int_t *p_libvlc, char const *psz_module ) 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 ) ) /***************************************************************************** @@ -1424,7 +1392,7 @@ static void Usage( libvlc_int_t *p_this, char const *psz_search ) : !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] ) @@ -1862,7 +1830,7 @@ static void ListModules( libvlc_int_t *p_this, bool b_verbose ) 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 ) ) { @@ -1999,15 +1967,3 @@ static int ConsoleWidth( void ) return i_width; } - -#include - -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); -}