]> git.sesse.net Git - vlc/commitdiff
* Some more fixes (+ don't redefine a function that already existed, reverts part...
authorAntoine Cellerier <dionoea@videolan.org>
Sun, 20 May 2007 14:04:46 +0000 (14:04 +0000)
committerAntoine Cellerier <dionoea@videolan.org>
Sun, 20 May 2007 14:04:46 +0000 (14:04 +0000)
include/vlc_objects.h
modules/control/http/http.c
modules/demux/playlist/luaplaylist.c
modules/gui/skins2/win32/win32_factory.cpp
src/libvlc-common.c
src/misc/beos_specific.cpp
src/misc/darwin_specific.c
src/misc/objects.c
src/misc/win32_specific.c
src/modules/configuration.c

index 6058b0b2eb2521cfe3b9f048f59d28f35b172666..a906d517cc9aea7af324bb62369673b711d324af 100644 (file)
@@ -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) \
index 08863cf4b185285afb61996459b7e13f5a170cd5..f1b3416706c42faa4e658ba993b14be329f41c8f 100644 (file)
@@ -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" );
index 2c4b0f1db990d0efaf6d427e8df1610226f430ee..9720fdcb95ce1973531318c76daeb2730d7af840 100644 (file)
@@ -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
     {
index 603fd93ebd15f5f1d31eac405207b27e9db91038..6fbe0e87307494ed5e569114faad2916aa0c3b9e 100644 (file)
@@ -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
index d161ba0b0c8b00fe5fbfc160be9f765d2915cf41..9f78e0b2729afce243da00810309c6e28a5c0b22 100644 (file)
@@ -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;
 
index 610accbc8ac2189d54082cdd7a98e80e4159a8f2..34e724923f69ecc91aba6fb8e92e8ea59fa2574c 100644 (file)
@@ -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 );
index 9a3ca5ae7579b5ea68bad3d068aa03b460662bb6..da939ac87a847d949e5ae5e9aafffc54180c9736 100644 (file)
@@ -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 );
 }
 
index 2884fadb72d6293b8d9b988596451b74b4db70bf..2ce0126ef4f8d3de1a3b019d12cf6ccc93b785a9 100644 (file)
@@ -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
index c318c7d46e7a6b5dc912cd9c74559b21eafbb10c..1cce6aa5d93cc40a53fbf6f2247277fd1f0b87ec 100644 (file)
@@ -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();
index 86e0571bf42b5138f6d05a327cf7865db7e9bf70..fb5fcc6208e2c8c90d6efb1a68c0461bab1b65da 100644 (file)
@@ -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;