Commit 575b4f39 authored by dionoea's avatar dionoea
Browse files

* Some more fixes (+ don't redefine a function that already existed, reverts...

* Some more fixes (+ don't redefine a function that already existed, reverts part of previous commit).
parent 278b0b2a
......@@ -110,10 +110,6 @@ VLC_EXPORT( vlc_list_t *, __vlc_list_find, ( vlc_object_t *, int, int ) );
VLC_EXPORT( void, vlc_list_release, ( vlc_list_t * ) );
VLC_EXPORT( libvlc_int_t *, vlc_current_object, ( int ) );
#if defined( WIN32 ) || defined( SYS_BEOS ) || defined( __APPLE__ )
VLC_EXPORT( const char *, vlc_path, ( vlc_object_t * ) );
#endif
/*}@*/
#define vlc_object_create(a,b) \
......
......@@ -290,14 +290,10 @@ static int Open( vlc_object_t *p_this )
#if defined(__APPLE__) || defined(SYS_BEOS) || defined(WIN32)
if ( ( psz_src = config_GetPsz( p_intf, "http-src" )) == NULL )
{
char * psz_vlcpath = vlc_path( p_intf );
psz_src = malloc( strlen(psz_vlcpath) + strlen("/share/http" ) + 1 );
char * psz_vlcpath = config_GetDataDir( p_intf );
psz_src = malloc( strlen(psz_vlcpath) + strlen("/http" ) + 1 );
if( !psz_src ) return VLC_ENOMEM;
#if defined(WIN32)
sprintf( psz_src, "%s/http", psz_vlcpath );
#else
sprintf( psz_src, "%s/share/http", psz_vlcpath );
#endif
}
#else
psz_src = config_GetPsz( p_intf, "http-src" );
......
......@@ -296,14 +296,10 @@ int E_(Import_LuaPlaylist)( vlc_object_t *p_this )
# if defined(__APPLE__) || defined(SYS_BEOS) || defined(WIN32)
{
char *psz_vlcpath = vlc_path( p_demux );
ppsz_dir_list[1] = malloc( strlen( psz_vlcpath ) + strlen( "/share/luaplaylist" ) + 1 );
char *psz_vlcpath = config_GetDataDir( p_demux );
ppsz_dir_list[1] = malloc( strlen( psz_vlcpath ) + strlen( "luaplaylist" ) + 1 );
if( !ppsz_dir_list[1] ) return VLC_ENOMEM;
# if defined( WIN32 )
sprintf( ppsz_dir_list[1], "%s/luaplaylist", psz_vlcpath );
# else
sprintf( ppsz_dir_list[1], "%s/share/luaplaylist", psz_vlcpath );
# endif
sprintf( ppsz_dir_list[1], "%s/luaplaylist", psz_vlcpath );
}
# else
{
......
......@@ -227,13 +227,13 @@ bool Win32Factory::init()
// Initialize the resource path
m_resourcePath.push_back( (string)getIntf()->p_libvlc->psz_homedir +
"\\" + CONFIG_DIR + "\\skins" );
m_resourcePath.push_back( (string)vlc_path( getIntf() ) +
m_resourcePath.push_back( (string)config_GetDataDir( getIntf() ) +
"\\skins" );
m_resourcePath.push_back( (string)vlc_path( getIntf() ) +
m_resourcePath.push_back( (string)config_GetDataDir( getIntf() ) +
"\\skins2" );
m_resourcePath.push_back( (string)vlc_path( getIntf() ) +
m_resourcePath.push_back( (string)config_GetDataDir( getIntf() ) +
"\\share\\skins" );
m_resourcePath.push_back( (string)vlc_path( getIntf() ) +
m_resourcePath.push_back( (string)config_GetDataDir( getIntf() ) +
"\\share\\skins2" );
// All went well
......
......@@ -1196,7 +1196,7 @@ static inline int LoadMessages (void)
#else
char psz_path[1024];
if (snprintf (psz_path, sizeof (psz_path), "%s/%s",
libvlc_global.psz_vlcpath, "locale")
vlc_global( &libvlc_global )->psz_vlcpath, "locale")
>= (int)sizeof (psz_path))
return -1;
......
......@@ -105,7 +105,7 @@ void system_End( libvlc_int_t *p_this )
vlc_thread_join( p_this->p_libvlc_global->p_appthread );
vlc_object_destroy( p_this->p_libvlc_global->p_appthread );
free( p_this->p_libvlc_global->psz_vlcpath );
free( vlc_global( p_this )->psz_vlcpath );
}
/* following functions are local */
......@@ -172,7 +172,7 @@ void VlcApplication::ReadyToRun( )
BEntry entry( &info.ref );
entry.GetPath( &path );
path.GetParent( &path );
p_this->p_libvlc_global->psz_vlcpath = strdup( path.Path() );
vlc_global( p_this )->psz_vlcpath = strdup( path.Path() );
/* Tell the main thread we are finished initializing the BApplication */
vlc_thread_ready( p_this );
......
......@@ -70,7 +70,7 @@ void system_Init( libvlc_int_t *p_this, int *pi_argc, char *ppsz_argv[] )
char *p_char, *p_oldchar = &i_dummy;
/* Get the full program path and name */
p_char = p_this->p_libvlc_global->psz_vlcpath = strdup( ppsz_argv[ 0 ] );
p_char = vlc_global( p_this )->psz_vlcpath = strdup( ppsz_argv[ 0 ] );
/* Remove trailing program name */
for( ; *p_char ; )
......@@ -116,8 +116,8 @@ void system_Init( libvlc_int_t *p_this, int *pi_argc, char *ppsz_argv[] )
CFRelease( all_locales );
}
vlc_mutex_init( p_this, &p_this->p_libvlc_global->iconv_lock );
p_this->p_libvlc_global->iconv_macosx = vlc_iconv_open( "UTF-8", "UTF-8-MAC" );
vlc_mutex_init( p_this, &vlc_global( p_this )->iconv_lock );
vlc_global( p_this )->iconv_macosx = vlc_iconv_open( "UTF-8", "UTF-8-MAC" );
}
/*****************************************************************************
......@@ -133,10 +133,10 @@ void system_Configure( libvlc_int_t *p_this, int *pi_argc, char *ppsz_argv[] )
*****************************************************************************/
void system_End( libvlc_int_t *p_this )
{
free( p_this->p_libvlc_global->psz_vlcpath );
free( vlc_global( p_this )->psz_vlcpath );
if ( p_this->p_libvlc_global->iconv_macosx != (vlc_iconv_t)-1 )
vlc_iconv_close( p_this->p_libvlc_global->iconv_macosx );
vlc_mutex_destroy( &p_this->p_libvlc_global->iconv_lock );
if ( vlc_global( p_this )->iconv_macosx != (vlc_iconv_t)-1 )
vlc_iconv_close( vlc_global( p_this )->iconv_macosx );
vlc_mutex_destroy( &vlc_global( p_this )->iconv_lock );
}
......@@ -1370,11 +1370,3 @@ static void ListChildren( vlc_list_t *p_list, vlc_object_t *p_this, int i_type )
}
}
}
#if defined( WIN32 ) || defined( SYS_BEOS ) || defined( __APPLE__ )
const char *vlc_path( vlc_object_t *p_this )
{
return vlc_global( p_this )->psz_vlcpath;
}
#endif
......@@ -72,7 +72,7 @@ void system_Init( libvlc_int_t *p_this, int *pi_argc, char *ppsz_argv[] )
if( (psz_vlc = strrchr( psz_path, '\\' )) ) *psz_vlc = '\0';
p_this->p_libvlc_global->psz_vlcpath = strdup( psz_path );
vlc_global( p_this )->psz_vlcpath = strdup( psz_path );
/* Set the default file-translation mode */
#if !defined( UNDER_CE )
......@@ -351,10 +351,10 @@ LRESULT CALLBACK WMCOPYWNDPROC( HWND hwnd, UINT uMsg, WPARAM wParam,
*****************************************************************************/
void system_End( libvlc_int_t *p_this )
{
if( p_this && p_this->p_libvlc_global && p_this->p_libvlc_global->psz_vlcpath )
if( p_this && p_this->p_libvlc_global && vlc_global( p_this )->psz_vlcpath )
{
free( p_this->p_libvlc_global->psz_vlcpath );
p_this->p_libvlc_global->psz_vlcpath = NULL;
free( vlc_global( p_this )->psz_vlcpath );
vlc_global( p_this )->psz_vlcpath = NULL;
}
WSACleanup();
......
......@@ -1715,14 +1715,14 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[],
const char *config_GetDataDir( const vlc_object_t *p_this )
{
#if defined (WIN32) || defined (UNDER_CE)
return p_this->p_libvlc_global->psz_vlcpath;
return vlc_global( p_this )->psz_vlcpath;
#elif defined(__APPLE__) || defined (SYS_BEOS)
static char path[PATH_MAX] = "";
if( *path == '\0' )
{
snprintf( path, sizeof( path ), "%s/share",
p_this->p_libvlc_global->psz_vlcpath );
vlc_global( p_this )->psz_vlcpath );
path[sizeof( path ) - 1] = '\0';
}
return path;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment