Changeset 2fe5a2c748b2c568ac4977bc1a73309fedc68266

Show
Ignore:
Timestamp:
17/02/03 06:50:31 (6 years ago)
Author:
Sam Hocevar <sam@videolan.org>
git-committer:
Sam Hocevar <sam@videolan.org> 1045461031 +0000
git-parent:

[b42e431cad7b298e96c9ed4d6e1338fc89297a84]

git-author:
Sam Hocevar <sam@videolan.org> 1045461031 +0000
Message:
  • ./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.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • include/main.h

    r0e93bc6 r2fe5a2c  
    44 ***************************************************************************** 
    55 * Copyright (C) 1999, 2000, 2001, 2002 VideoLAN 
    6  * $Id: main.h,v 1.52 2003/01/19 03:16:24 sam Exp $ 
     6 * $Id: main.h,v 1.53 2003/02/17 05:50:31 sam Exp $ 
    77 * 
    88 * Authors: Vincent Seguin <seguin@via.ecp.fr> 
     
    6565    vlc_bool_t             b_fast_mutex; 
    6666    int                    i_win9x_cv; 
     67    char *                 psz_vlcpath; 
    6768#endif 
    6869}; 
  • modules/codec/spudec/spudec.c

    r98bd3d5 r2fe5a2c  
    33 ***************************************************************************** 
    44 * Copyright (C) 2000-2001 VideoLAN 
    5  * $Id: spudec.c,v 1.14 2003/01/30 16:36:04 gbazin Exp $ 
     5 * $Id: spudec.c,v 1.15 2003/02/17 05:50:31 sam Exp $ 
    66 * 
    77 * Authors: Samuel Hocevar <sam@zoy.org> 
     
    5555vlc_module_begin(); 
    5656    add_category_hint( N_("subtitles"), NULL ); 
    57 #if defined(SYS_DARWIN) || defined(SYS_BEOS) 
     57#if defined(SYS_DARWIN) || defined(SYS_BEOS) \ 
     58     || (defined(WIN32) && !defined(UNDER_CE)) 
    5859    add_file( "spudec-font", NULL, NULL, 
    5960              FONT_TEXT, FONT_LONGTEXT ); 
    6061#else 
    61     add_file( "spudec-font", "./share/" DEFAULT_FONT, NULL, 
     62    add_file( "spudec-font", "share/" DEFAULT_FONT, NULL, 
    6263              FONT_TEXT, FONT_LONGTEXT ); 
    6364#endif 
     
    136137            sprintf(psz_font, "%s/share/" DEFAULT_FONT, psz_vlcpath); 
    137138        } 
     139#elif defined(WIN32) && !defined(UNDER_CE) 
     140        if ( (psz_font = config_GetPsz( p_fifo, "spudec-font" )) == NULL ) 
     141        { 
     142            char * psz_vlcpath = p_fifo->p_libvlc->psz_vlcpath; 
     143            psz_font = malloc( strlen(psz_vlcpath) + strlen("\\share\\") 
     144                                + strlen(DEFAULT_FONT) + 1 ); 
     145            sprintf(psz_font, "%s\\share\\" DEFAULT_FONT, psz_vlcpath); 
     146        } 
    138147#else 
    139148        if( (psz_font = config_GetPsz( p_fifo, "spudec-font" )) == NULL ) 
  • src/misc/modules.c

    rf716766 r2fe5a2c  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001 VideoLAN 
    5  * $Id: modules.c,v 1.111 2003/01/27 17:41:01 ipkiss Exp $ 
     5 * $Id: modules.c,v 1.112 2003/02/17 05:50:31 sam Exp $ 
    66 * 
    77 * Authors: Samuel Hocevar <sam@zoy.org> 
     
    552552    char **         ppsz_path = path; 
    553553    char *          psz_fullpath; 
    554 #if defined( SYS_BEOS ) || defined( SYS_DARWIN ) 
     554#if defined( SYS_BEOS ) || defined( SYS_DARWIN ) \ 
     555     || ( defined( WIN32 ) && !defined( UNDER_CE ) ) 
    555556    int             i_vlclen = strlen( p_this->p_libvlc->psz_vlcpath ); 
    556557    vlc_bool_t      b_notinroot; 
     
    567568    for( ; *ppsz_path != NULL ; ppsz_path++ ) 
    568569    { 
    569 #if defined( SYS_BEOS ) || defined( SYS_DARWIN ) 
     570#if defined( SYS_BEOS ) || defined( SYS_DARWIN ) \ 
     571     || ( defined( WIN32 ) && !defined( UNDER_CE ) ) 
    570572        /* Store strlen(*ppsz_path) for later use. */ 
    571573        int i_dirlen = strlen( *ppsz_path ); 
     
    574576        /* Under BeOS, we need to add beos_GetProgramPath() to access 
    575577         * files under the current directory */ 
    576         if( ( i_dirlen > 1 ) && strncmp( *ppsz_path, "/", 1 ) ) 
     578#ifdef WIN32 
     579        if( i_dirlen < 3 || ppsz_path[3] != '\\' ) 
     580#else 
     581        if( ppsz_path[0] != '/' ) 
     582#endif 
    577583        { 
    578584            i_dirlen += i_vlclen + 2; 
  • src/misc/win32_specific.c

    r0e93bc6 r2fe5a2c  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001 VideoLAN 
    5  * $Id: win32_specific.c,v 1.20 2003/01/19 03:16:24 sam Exp $ 
     5 * $Id: win32_specific.c,v 1.21 2003/02/17 05:50:31 sam Exp $ 
    66 * 
    77 * Authors: Samuel Hocevar <sam@zoy.org> 
     
    4040    WSADATA Data; 
    4141    int i_err; 
     42 
     43    /* Get our full path */ 
     44    if( ppsz_argv[0] ) 
     45    { 
     46        char psz_path[MAX_PATH]; 
     47        char *psz_vlc; 
     48 
     49        GetFullPathName( ppsz_argv[0], MAX_PATH, psz_path, &psz_vlc ); 
     50 
     51        if( psz_vlc > psz_path && psz_vlc[-1] == '\\' ) 
     52        { 
     53            psz_vlc[-1] = '\0'; 
     54            p_this->p_libvlc->psz_vlcpath = strdup( psz_path ); 
     55        } 
     56        else 
     57        { 
     58            p_this->p_libvlc->psz_vlcpath = strdup( "" ); 
     59        } 
     60    } 
     61    else 
     62    { 
     63        p_this->p_libvlc->psz_vlcpath = strdup( "" ); 
     64    } 
    4265 
    4366    /* WinSock Library Init. */