* 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>
*
SIGNALOBJECTANDWAIT SignalObjectAndWait;
vlc_bool_t b_fast_mutex;
int i_win9x_cv;
+ char * psz_vlcpath;
#endif
};
* 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>
*
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") );
+ 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 )
{
* 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>
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
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;
* 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>
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 );