set_description( N_("Lua Interface Module") )
set_capability( "interface", 0 )
add_string( "lua-intf", "dummy", NULL,
- INTF_TEXT, INTF_LONGTEXT, false );
+ INTF_TEXT, INTF_LONGTEXT, false )
add_string( "lua-config", "", NULL,
- CONFIG_TEXT, CONFIG_LONGTEXT, false );
+ CONFIG_TEXT, CONFIG_LONGTEXT, false )
set_callbacks( Open_LuaIntf, Close_LuaIntf )
vlc_module_end ()
return strcmp( *a, *b );
}
-int vlclua_dir_list( const char *luadirname, char **ppsz_dir_list )
+int vlclua_dir_list( vlc_object_t *p_this, const char *luadirname, char **ppsz_dir_list )
{
int i = 0;
- char *datadir = config_GetUserDataDir();
+ char *datadir = config_GetUserDir( VLC_DATA_DIR );
if( datadir == NULL )
return VLC_ENOMEM;
free( datadir );
i++;
+ char *psz_datapath = config_GetDataDir( p_this );
# if defined(__APPLE__) || defined(SYS_BEOS) || defined(WIN32)
{
- const char *psz_vlcpath = config_GetDataDir();
if( asprintf( &ppsz_dir_list[i], "%s" DIR_SEP "lua" DIR_SEP "%s",
- psz_vlcpath, luadirname ) < 0 )
+ psz_datapath, luadirname ) < 0 )
return VLC_ENOMEM;
i++;
if( asprintf( &ppsz_dir_list[i], "%s" DIR_SEP "share" DIR_SEP "lua" DIR_SEP "%s",
- psz_vlcpath, luadirname ) < 0 )
+ psz_datapath, luadirname ) < 0 )
return VLC_ENOMEM;
i++;
}
# else
if( asprintf( &ppsz_dir_list[i], "%s" DIR_SEP "lua" DIR_SEP "%s",
- config_GetDataDir (), luadirname ) < 0 )
+ psz_datapath, luadirname ) < 0 )
return VLC_ENOMEM;
i++;
# endif
+ free( psz_datapath );
return VLC_SUCCESS;
}
char *ppsz_dir_list[] = { NULL, NULL, NULL, NULL };
char **ppsz_dir;
- i_ret = vlclua_dir_list( luadirname, ppsz_dir_list );
+ i_ret = vlclua_dir_list( p_this, luadirname, ppsz_dir_list );
if( i_ret != VLC_SUCCESS )
return i_ret;
i_ret = VLC_EGENERIC;
psz_meta_category, psz_meta_name,
psz_meta_value );
input_item_AddInfo( p_input, psz_meta_category,
- psz_meta_name, psz_meta_value );
+ psz_meta_name, "%s", psz_meta_value );
}
lua_pop( L, 1 ); /* pop item */
/* ... item meta key value key2 */
p_input = input_item_NewExt( p_playlist, psz_path,
psz_name, i_options,
(const char **)ppsz_options,
+ VLC_INPUT_OPTION_TRUSTED,
i_duration );
lua_pop( L, 3 ); /* pop "path name item" */
/* playlist key item */