#endif
-#include <vlc_media_library.h>
#include <vlc_playlist.h>
#include <vlc_interface.h>
* The evil global variables. We handle them with care, don't worry.
*****************************************************************************/
-#if !defined(WIN32) && !defined(__OS2__)
+#if !defined(_WIN32) && !defined(__OS2__)
static bool b_daemon = false;
#endif
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->ml_lock );
vlc_ExitInit( &priv->exit );
return p_libvlc;
/* some default internal settings */
var_Create( p_libvlc, "window", VLC_VAR_STRING );
+ /* NOTE: Because the playlist and interfaces start before this function
+ * returns control to the application (DESIGN BUG!), all these variables
+ * must be created (in place of libvlc_new()) and set to VLC defaults
+ * (in place of VLC main()) *here*. */
var_Create( p_libvlc, "user-agent", VLC_VAR_STRING );
- var_SetString( p_libvlc, "user-agent", "(LibVLC "VERSION")" );
+ var_SetString( p_libvlc, "user-agent",
+ "VLC media player (LibVLC "VERSION")" );
+ var_Create( p_libvlc, "http-user-agent", VLC_VAR_STRING );
+ var_SetString( p_libvlc, "http-user-agent",
+ "VLC/"PACKAGE_VERSION" LibVLC/"PACKAGE_VERSION );
+ var_Create( p_libvlc, "app-icon-name", VLC_VAR_STRING );
+ var_SetString( p_libvlc, "app-icon-name", PACKAGE_NAME );
+ var_Create( p_libvlc, "app-id", VLC_VAR_STRING );
+ var_SetString( p_libvlc, "app-id", "org.VideoLAN.VLC" );
+ var_Create( p_libvlc, "app-version", VLC_VAR_STRING );
+ var_SetString( p_libvlc, "app-version", PACKAGE_VERSION );
/* 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" ) )
- {
- 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
-
#ifdef ENABLE_VLM
/* Initialize VLM if vlm-conf is specified */
psz_parser = var_CreateGetNonEmptyString( p_libvlc, "vlm-conf" );
var_Create( p_libvlc, "drawable-clip-right", VLC_VAR_INTEGER );
var_Create( p_libvlc, "drawable-nsobject", VLC_VAR_ADDRESS );
#endif
-#if defined (WIN32) || defined (__OS2__)
+#if defined (_WIN32) || defined (__OS2__)
var_Create( p_libvlc, "drawable-hwnd", VLC_VAR_INTEGER );
#endif
}
#endif
-#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
-
/* Free playlist now, all threads are gone */
playlist_t *p_playlist = libvlc_priv (p_libvlc)->p_playlist;
if( p_playlist != NULL )
msg_Dbg( p_libvlc, "removing stats" );
-#if !defined( WIN32 ) && !defined( __OS2__ )
+#if !defined( _WIN32 ) && !defined( __OS2__ )
char* psz_pidfile = NULL;
if( b_daemon )
/* Free module bank. It is refcounted, so we call this each time */
module_EndBank (true);
vlc_LogDeinit (p_libvlc);
-#if defined(WIN32) || defined(__OS2__)
+#if defined(_WIN32) || defined(__OS2__)
system_End( );
#endif
}
{
libvlc_priv_t *priv = libvlc_priv( p_libvlc );
- /* Destroy mutexes */
vlc_ExitDestroy( &priv->exit );
- vlc_mutex_destroy( &priv->ml_lock );
assert( atomic_load(&(vlc_internals(p_libvlc)->refs)) == 1 );
vlc_object_release( p_libvlc );
char *psz_interface = var_CreateGetNonEmptyString( p_libvlc, "intf" );
if( !psz_interface ) /* "intf" has not been set */
{
-#if !defined( WIN32 ) && !defined( __OS2__ )
+#if !defined( _WIN32 ) && !defined( __OS2__ )
if( b_daemon )
/* Daemon mode hack.
* We prefer the dummy interface if none is specified. */