]> git.sesse.net Git - vlc/blobdiff - src/libvlc.c
Support old-style module separators and yell at the user. (Closes #111)
[vlc] / src / libvlc.c
index 60189bb2f185f30ae23153a6c667289acd14d3c6..56fdcd4793b416d6d63794daf3f7240687bede6a 100644 (file)
@@ -574,7 +574,7 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] )
     if( !config_GetInt( p_vlc, "fpu" ) )
         libvlc.i_cpu &= ~CPU_CAPABILITY_FPU;
 
-#if defined( __i386__ )
+#if defined( __i386__ ) || defined( __x86_64__ )
     if( !config_GetInt( p_vlc, "mmx" ) )
         libvlc.i_cpu &= ~CPU_CAPABILITY_MMX;
     if( !config_GetInt( p_vlc, "3dn" ) )
@@ -669,7 +669,7 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] )
     {
         psz_modules = (char *)realloc( psz_modules, strlen( psz_modules ) +
                                                     strlen( psz_control ) + 1 );
-        sprintf( psz_modules, "%s,%s", psz_modules, psz_control );
+        sprintf( psz_modules, "%s:%s", psz_modules, psz_control );
     }
     else if( psz_control && *psz_control )
     {
@@ -678,11 +678,19 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] )
     }
 
     psz_parser = psz_modules;
+    if( psz_parser && *psz_parser &&
+       strstr( psz_parser, ",") && !strstr(psz_parser, ":" ) )
+    {
+        msg_Info( p_vlc, "Warning: you are using a deprecated syntax for "
+                         "extraintf / control." );
+        msg_Info( p_vlc, "You must now use ':' as separator instead of ','." );
+    }
     while ( psz_parser && *psz_parser )
     {
         char *psz_module, *psz_temp;
         psz_module = psz_parser;
-        psz_parser = strchr( psz_module, ',' );
+        psz_parser = strchr( psz_module, ':' );
+        if( !psz_parser ) psz_parser = strchr( psz_module, ',' );
         if ( psz_parser )
         {
             *psz_parser = '\0';
@@ -1030,6 +1038,31 @@ int VLC_VariableGet( int i_object, char const *psz_var, vlc_value_t *p_value )
     return i_ret;
 }
 
+/*****************************************************************************
+ * VLC_VariableType: get a vlc variable type
+ *****************************************************************************/
+int VLC_VariableType( int i_object, char const *psz_var, int *pi_type )
+{
+    int i_type;
+    vlc_t *p_vlc = vlc_current_object( i_object );
+
+    if( !p_vlc )
+    {
+        return VLC_ENOOBJ;
+    }
+
+    i_type = VLC_VAR_TYPE & var_Type( p_vlc , psz_var );
+
+    if( i_object ) vlc_object_release( p_vlc );
+
+    if( i_type > 0 )
+    {
+        *pi_type = i_type;
+        return VLC_SUCCESS;
+    }
+    return VLC_ENOVAR;
+}
+
 /*****************************************************************************
  * VLC_AddTarget: adds a target for playing.
  *****************************************************************************
@@ -1339,12 +1372,14 @@ int VLC_TimeSet( int i_object, int i_seconds, vlc_bool_t b_relative )
 
     if( b_relative )
     {
-        val.i_time = i_seconds * 1000000;
+        val.i_time = i_seconds;
+        val.i_time = val.i_time * 1000000L;
         var_Set( p_input, "time-offset", val );
     }
     else
     {
-        val.i_time = i_seconds * 1000000;
+        val.i_time = i_seconds;
+        val.i_time = val.i_time * 1000000L;
         var_Set( p_input, "time", val );
     }
     vlc_object_release( p_input );
@@ -1386,7 +1421,7 @@ int VLC_LengthGet( int i_object )
     vlc_object_release( p_input );
 
     if( i_object ) vlc_object_release( p_vlc );
-    return val.i_time  / 1000000;
+    return val.i_time  / 1000000L;
 }
 
 /**
@@ -2360,6 +2395,7 @@ static void InitDeviceValues( vlc_t *p_vlc )
 
                 hal_free_string( block_dev );
             }
+            hal_free_string_array( devices );
         }
 
         hal_shutdown( ctx );