]> git.sesse.net Git - vlc/blobdiff - src/modules/modules.c
libvlccore: fix AUTO_ADJUST_PTS_DELAY short comment.
[vlc] / src / modules / modules.c
index 0e25c855c021cb87ab2b8d38cd763d631485cf47..9ff601b3a6aa5916a564b14758292fdc99d412df 100644 (file)
@@ -371,11 +371,7 @@ module_t * __module_Need( vlc_object_t *p_this, const char *psz_capability,
     /* Deal with variables */
     if( psz_name && psz_name[0] == '$' )
     {
-        vlc_value_t val;
-        var_Create( p_this, psz_name + 1, VLC_VAR_MODULE | VLC_VAR_DOINHERIT );
-        var_Get( p_this, psz_name + 1, &val );
-        psz_var = val.psz_string;
-        psz_name = psz_var;
+        psz_name = psz_var = var_CreateGetString( p_this, psz_name + 1 );
     }
 
     /* Count how many different shortcuts were asked for */
@@ -874,14 +870,21 @@ static char * copy_next_paths_token( char * paths, char ** remaining_paths )
     if( !path ) return NULL;
 
     /* Look for PATH_SEP_CHAR (a ':' or a ';') */
-    for( i = 0, done = 0 ; paths[i]; i++ ) {
+    for( i = 0, done = 0 ; paths[i]; i++ )
+    {
         /* Take care of \\ and \: or \; escapement */
-        if( escaped ) {
+        if( escaped )
+        {
             escaped = false;
             path[done++] = paths[i];
         }
+#ifdef WIN32
+        else if( paths[i] == '/' )
+            escaped = true;
+#else
         else if( paths[i] == '\\' )
             escaped = true;
+#endif
         else if( paths[i] == PATH_SEP_CHAR )
             break;
         else
@@ -920,14 +923,14 @@ static void AllocateAllPlugins( vlc_object_t *p_this )
 #endif
 
     /* If the user provided a plugin path, we add it to the list */
-    char * userpaths = config_GetPsz( p_this, "plugin-path" );
+    char *userpaths = config_GetPsz( p_this, "plugin-path" );
     char *paths_iter;
 
     for( paths_iter = userpaths; paths_iter; )
     {
         path = copy_next_paths_token( paths_iter, &paths_iter );
         if( path )
-            vlc_array_append( arraypaths, strdup( path ) );
+            vlc_array_append( arraypaths, path );
     }
 
     count = vlc_array_count( arraypaths );
@@ -946,6 +949,7 @@ static void AllocateAllPlugins( vlc_object_t *p_this )
     }
 
     vlc_array_destroy( arraypaths );
+    free( userpaths );
 }
 
 /*****************************************************************************
@@ -1212,6 +1216,7 @@ static int AllocatePluginFile( vlc_object_t * p_this, char * psz_file,
         p_bank->pp_cache[p_bank->i_cache]->b_used = true;
         p_bank->pp_cache[p_bank->i_cache]->p_module = p_module;
         p_bank->i_cache++;
+#undef p_bank
     }
 
     return p_module ? 0 : -1;
@@ -1237,7 +1242,6 @@ static module_t * AllocatePlugin( vlc_object_t * p_this, char * psz_file )
     p_module = vlc_module_create( p_this );
     if( p_module == NULL )
     {
-        msg_Err( p_this, "out of memory" );
         module_Unload( handle );
         return NULL;
     }
@@ -1341,10 +1345,7 @@ static int AllocateBuiltinModule( vlc_object_t * p_this,
      * allocate a structure for it */
     p_module = vlc_module_create( p_this );
     if( p_module == NULL )
-    {
-        msg_Err( p_this, "out of memory" );
         return -1;
-    }
 
     /* Initialize the module : fill p_module->psz_object_name, etc. */
     if( pf_entry( p_module ) != 0 )