Commit 2fe5a2c7 authored by Sam Hocevar's avatar Sam Hocevar
Browse files

* ./src/misc/win32_specific.c: under Win32 we retrieve the executable's

    directory whenever possible, to use it for the spudec font or to load
    plugins.
parent b42e431c
......@@ -3,7 +3,7 @@
* Declaration and extern access to global program object.
*****************************************************************************
* Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
* $Id: main.h,v 1.52 2003/01/19 03:16:24 sam Exp $
* $Id: main.h,v 1.53 2003/02/17 05:50:31 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
......@@ -64,6 +64,7 @@ struct libvlc_t
SIGNALOBJECTANDWAIT SignalObjectAndWait;
vlc_bool_t b_fast_mutex;
int i_win9x_cv;
char * psz_vlcpath;
#endif
};
......
......@@ -2,7 +2,7 @@
* spudec.c : SPU decoder thread
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: spudec.c,v 1.14 2003/01/30 16:36:04 gbazin Exp $
* $Id: spudec.c,v 1.15 2003/02/17 05:50:31 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -54,11 +54,12 @@ static vout_thread_t *FindVout( spudec_thread_t * );
vlc_module_begin();
add_category_hint( N_("subtitles"), NULL );
#if defined(SYS_DARWIN) || defined(SYS_BEOS)
#if defined(SYS_DARWIN) || defined(SYS_BEOS) \
|| (defined(WIN32) && !defined(UNDER_CE))
add_file( "spudec-font", NULL, NULL,
FONT_TEXT, FONT_LONGTEXT );
#else
add_file( "spudec-font", "./share/" DEFAULT_FONT, NULL,
add_file( "spudec-font", "share/" DEFAULT_FONT, NULL,
FONT_TEXT, FONT_LONGTEXT );
#endif
set_description( _("subtitles decoder module") );
......@@ -135,6 +136,14 @@ static int RunDecoder( decoder_fifo_t * p_fifo )
+ strlen(DEFAULT_FONT) + 1 );
sprintf(psz_font, "%s/share/" DEFAULT_FONT, psz_vlcpath);
}
#elif defined(WIN32) && !defined(UNDER_CE)
if ( (psz_font = config_GetPsz( p_fifo, "spudec-font" )) == NULL )
{
char * psz_vlcpath = p_fifo->p_libvlc->psz_vlcpath;
psz_font = malloc( strlen(psz_vlcpath) + strlen("\\share\\")
+ strlen(DEFAULT_FONT) + 1 );
sprintf(psz_font, "%s\\share\\" DEFAULT_FONT, psz_vlcpath);
}
#else
if( (psz_font = config_GetPsz( p_fifo, "spudec-font" )) == NULL )
{
......
......@@ -2,7 +2,7 @@
* modules.c : Builtin and plugin modules management functions
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: modules.c,v 1.111 2003/01/27 17:41:01 ipkiss Exp $
* $Id: modules.c,v 1.112 2003/02/17 05:50:31 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Ethan C. Baldridge <BaldridgeE@cadmus.com>
......@@ -551,7 +551,8 @@ static void AllocateAllPlugins( vlc_object_t *p_this )
char ** ppsz_path = path;
char * psz_fullpath;
#if defined( SYS_BEOS ) || defined( SYS_DARWIN )
#if defined( SYS_BEOS ) || defined( SYS_DARWIN ) \
|| ( defined( WIN32 ) && !defined( UNDER_CE ) )
int i_vlclen = strlen( p_this->p_libvlc->psz_vlcpath );
vlc_bool_t b_notinroot;
#endif
......@@ -566,14 +567,19 @@ static void AllocateAllPlugins( vlc_object_t *p_this )
for( ; *ppsz_path != NULL ; ppsz_path++ )
{
#if defined( SYS_BEOS ) || defined( SYS_DARWIN )
#if defined( SYS_BEOS ) || defined( SYS_DARWIN ) \
|| ( defined( WIN32 ) && !defined( UNDER_CE ) )
/* Store strlen(*ppsz_path) for later use. */
int i_dirlen = strlen( *ppsz_path );
b_notinroot = VLC_FALSE;
/* Under BeOS, we need to add beos_GetProgramPath() to access
* files under the current directory */
if( ( i_dirlen > 1 ) && strncmp( *ppsz_path, "/", 1 ) )
#ifdef WIN32
if( i_dirlen < 3 || ppsz_path[3] != '\\' )
#else
if( ppsz_path[0] != '/' )
#endif
{
i_dirlen += i_vlclen + 2;
b_notinroot = VLC_TRUE;
......
......@@ -2,7 +2,7 @@
* win32_specific.c: Win32 specific features
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: win32_specific.c,v 1.20 2003/01/19 03:16:24 sam Exp $
* $Id: win32_specific.c,v 1.21 2003/02/17 05:50:31 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Gildas Bazin <gbazin@netcourrier.com>
......@@ -40,6 +40,29 @@ void system_Init( vlc_t *p_this, int *pi_argc, char *ppsz_argv[] )
WSADATA Data;
int i_err;
/* Get our full path */
if( ppsz_argv[0] )
{
char psz_path[MAX_PATH];
char *psz_vlc;
GetFullPathName( ppsz_argv[0], MAX_PATH, psz_path, &psz_vlc );
if( psz_vlc > psz_path && psz_vlc[-1] == '\\' )
{
psz_vlc[-1] = '\0';
p_this->p_libvlc->psz_vlcpath = strdup( psz_path );
}
else
{
p_this->p_libvlc->psz_vlcpath = strdup( "" );
}
}
else
{
p_this->p_libvlc->psz_vlcpath = strdup( "" );
}
/* WinSock Library Init. */
i_err = WSAStartup( MAKEWORD( 1, 1 ), &Data );
......
Markdown is supported
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