#include "modules/modules.h"
#include "config/configuration.h"
-#include "interface/interface.h"
#include <errno.h> /* ENOMEM */
#include <stdio.h> /* sprintf() */
# include <locale.h>
#endif
+#ifdef ENABLE_NLS
+# include <libintl.h> /* bindtextdomain */
+#endif
+
#ifdef HAVE_DBUS
/* used for one-instance mode */
# include <dbus/dbus.h>
priv = libvlc_priv (p_libvlc);
priv->p_playlist = NULL;
- priv->p_interaction = NULL;
+ priv->p_dialog_provider = NULL;
priv->p_vlm = NULL;
p_libvlc->psz_object_name = strdup( "libvlc" );
/* Announce who we are - Do it only for first instance ? */
msg_Dbg( p_libvlc, "%s", COPYRIGHT_MESSAGE );
msg_Dbg( p_libvlc, "libvlc was configured with %s", CONFIGURE_LINE );
- /* Translate "C" to the language code: "fr", "en_GB", "nl", "ru"... */
+ /*xgettext: Translate "C" to the language code: "fr", "en_GB", "nl", "ru"... */
msg_Dbg( p_libvlc, "translation test: code is \"%s\"", _("C") );
/* Check for short help option */
*/
var_Create( p_libvlc, "key-pressed", VLC_VAR_INTEGER );
var_Create( p_libvlc, "key-action", VLC_VAR_INTEGER );
- p_libvlc->p_hotkeys = malloc( libvlc_hotkeys_size );
- /* Do a copy (we don't need to modify the strings) */
- memcpy( p_libvlc->p_hotkeys, libvlc_hotkeys, libvlc_hotkeys_size );
- var_AddCallback( p_libvlc, "key-pressed", vlc_key_to_action,
- p_libvlc->p_hotkeys );
+ {
+ struct hotkey *p_keys =
+ malloc( (libvlc_actions_count + 1) * sizeof (*p_keys) );
- /* Initialize interaction */
- priv->p_interaction = interaction_Init( p_libvlc );
+ /* Initialize from configuration */
+ for( size_t i = 0; i < libvlc_actions_count; i++ )
+ {
+ p_keys[i].psz_action = libvlc_actions[i].name;
+ p_keys[i].i_key = config_GetInt( p_libvlc,
+ libvlc_actions[i].name );
+ p_keys[i].i_action = libvlc_actions[i].value;
+ }
+ p_keys[libvlc_actions_count].psz_action = NULL;
+ p_keys[libvlc_actions_count].i_key = 0;
+ p_keys[libvlc_actions_count].i_action = 0;
+ p_libvlc->p_hotkeys = p_keys;
+ var_AddCallback( p_libvlc, "key-pressed", vlc_key_to_action,
+ p_keys );
+ }
/* Initialize playlist and get commandline files */
p_playlist = playlist_Create( VLC_OBJECT(p_libvlc) );
* Always load the hotkeys interface if it exists
*/
libvlc_InternalAddIntf( p_libvlc, "hotkeys,none" );
- if( module_exists( "globalhotkeys" ) )
- libvlc_InternalAddIntf( p_libvlc, "globalhotkeys,none" );
#ifdef HAVE_DBUS
/* loads dbus control interface if in one-instance mode
/*
* FIXME: kludge to use a p_libvlc-local variable for the Mozilla plugin
*/
- var_Create( p_libvlc, "drawable-xid", VLC_VAR_INTEGER );
+ var_Create( p_libvlc, "drawable-xid", VLC_VAR_DOINHERIT|VLC_VAR_INTEGER );
var_Create( p_libvlc, "drawable-hwnd", VLC_VAR_ADDRESS );
-#ifdef __APPLE__
- var_Create( p_libvlc, "drawable", VLC_VAR_INTEGER );
-#endif
+ var_Create( p_libvlc, "drawable-agl", VLC_VAR_INTEGER );
+ var_Create( p_libvlc, "drawable-gl", VLC_VAR_INTEGER );
+
var_Create( p_libvlc, "drawable-view-top", VLC_VAR_INTEGER );
var_Create( p_libvlc, "drawable-view-left", VLC_VAR_INTEGER );
var_Create( p_libvlc, "drawable-view-bottom", VLC_VAR_INTEGER );
vlc_object_release( p_playlist );
- /* Free interaction */
- msg_Dbg( p_libvlc, "removing interaction" );
- interaction_Destroy( priv->p_interaction );
-
stats_TimersDumpAll( p_libvlc );
stats_TimersCleanAll( p_libvlc );
FREENULL( priv->psz_configfile );
var_DelCallback( p_libvlc, "key-pressed", vlc_key_to_action,
- p_libvlc->p_hotkeys );
- FREENULL( p_libvlc->p_hotkeys );
+ (void *)p_libvlc->p_hotkeys );
+ free( (void *)p_libvlc->p_hotkeys );
}
/**
vlc_mutex_destroy( &priv->config_lock );
vlc_mutex_destroy( &priv->timer_lock );
+#ifndef NDEBUG /* Hack to dump leaked objects tree */
+ if( vlc_internals( p_libvlc )->i_refcount > 1 )
+ while( vlc_internals( p_libvlc )->i_refcount > 0 )
+ vlc_object_release( p_libvlc );
+#endif
+
+ assert( vlc_internals( p_libvlc )->i_refcount == 1 );
vlc_object_release( p_libvlc );
}
psz_module = "dummy";
else
#endif
- msg_Info( p_libvlc, _("Running vlc with the default interface. Use 'cvlc' to use vlc without interface.") );
+ msg_Info( p_libvlc, "%s",
+ _("Running vlc with the default interface. "
+ "Use 'cvlc' to use vlc without interface.") );
}
free( psz_interface );
}
utf8_fprintf( stdout, _("Compiled by %s@%s.%s\n"),
VLC_CompileBy(), VLC_CompileHost(), VLC_CompileDomain() );
utf8_fprintf( stdout, _("Compiler: %s\n"), VLC_Compiler() );
- utf8_fprintf( stdout, LICENSE_MSG );
+ utf8_fprintf( stdout, "%s", LICENSE_MSG );
#ifdef WIN32 /* Pause the console because it's destroyed when we exit */
PauseConsole();
(void)p_vlc;
#endif /* HAVE_HAL */
}
+
+#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);
+}