Changeset 75c438d3302e2a816a473576a35e17989d05a42c

Show
Ignore:
Timestamp:
05/06/08 22:15:51 (4 months ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1210104951 +0300
git-parent:

[d9d67e17350d62d8fe7481fd92e8b131ea3edcb9]

git-author:
Rémi Denis-Courmont <rem@videolan.org> 1210103817 +0300
Message:

Use config_GetCacheDir internally

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/input/meta.c

    rd6a7e48 r75c438d  
    240240                                  const char *psz_artist, const char *psz_album ) 
    241241{ 
     242   char *psz_cachedir = config_GetCacheDir(); 
     243 
    242244    if( !EMPTY_STR(psz_artist) && !EMPTY_STR(psz_album) ) 
    243245    { 
    244246        char * psz_album_sanitized = ArtCacheGetSanitizedFileName( psz_album ); 
    245247        char * psz_artist_sanitized = ArtCacheGetSanitizedFileName( psz_artist ); 
    246  
    247248        snprintf( psz_dir, PATH_MAX, "%s" DIR_SEP 
    248249                  "art" DIR_SEP "artistalbum" DIR_SEP "%s" DIR_SEP "%s", 
    249                       libvlc_priv (p_obj->p_libvlc)->psz_cachedir, 
    250                       psz_artist_sanitized, psz_album_sanitized ); 
     250                  psz_cachedir, psz_artist_sanitized, psz_album_sanitized ); 
    251251        free( psz_album_sanitized ); 
    252252        free( psz_artist_sanitized ); 
     
    257257        snprintf( psz_dir, PATH_MAX, "%s" DIR_SEP 
    258258                  "art" DIR_SEP "title" DIR_SEP "%s", 
    259                   libvlc_priv (p_obj->p_libvlc)->psz_cachedir, 
    260                   psz_title_sanitized ); 
     259                  psz_cachedir, psz_title_sanitized ); 
    261260        free( psz_title_sanitized ); 
    262261    } 
     262    free( psz_cachedir ); 
    263263} 
    264264 
  • src/libvlc-common.c

    rcb47bc0 r75c438d  
    299299    priv->psz_configdir  = config_GetUserConfDir(); 
    300300    priv->psz_datadir    = config_GetUserDataDir(); 
    301     priv->psz_cachedir   = config_GetCacheDir(); 
    302301    priv->psz_configfile = config_GetCustomConfigFile( p_libvlc ); 
    303302 
     
    10651064    free( priv->psz_configdir ); 
    10661065    free( priv->psz_datadir ); 
    1067     free( priv->psz_cachedir ); 
    10681066    FREENULL( priv->psz_configfile ); 
    10691067    var_DelCallback( p_libvlc, "key-pressed", vlc_key_to_action, 
  • src/libvlc.h

    rd6a7e48 r75c438d  
    214214    char              *psz_configdir;    ///< user configuration directory 
    215215    char              *psz_datadir;      ///< user data directory 
    216     char              *psz_cachedir; ///< user cache directory 
    217216 
    218217    /* There is no real reason to keep a list of items, but not to break 
  • src/modules/cache.c

    rd6a7e48 r75c438d  
    9797void CacheLoad( vlc_object_t *p_this ) 
    9898{ 
    99     char *psz_filename, *psz_cachedir
     99    char *psz_filename, *psz_cachedir = config_GetCacheDir()
    100100    FILE *file; 
    101101    int i, j, i_size, i_read; 
     
    107107    libvlc_global_data_t *p_libvlc_global = vlc_global(); 
    108108 
    109     psz_cachedir = libvlc_priv(p_this->p_libvlc)->psz_cachedir; 
    110109    if( !psz_cachedir ) /* XXX: this should never happen */ 
    111110    { 
     
    116115    i_size = asprintf( &psz_filename, "%s"DIR_SEP"%s", 
    117116                       psz_cachedir, CacheName() ); 
     117    free( psz_cachedir ); 
    118118    if( i_size <= 0 ) 
    119119    { 
    120         msg_Err( p_this, "out of memory" ); 
    121120        return; 
    122121    } 
     
    455454        "#   http://www.brynosaurus.com/cachedir/\r\n"; 
    456455 
    457     char *psz_cachedir
     456    char *psz_cachedir = config_GetCacheDir()
    458457    FILE *file; 
    459458    int i, j, i_cache; 
     
    462461    libvlc_global_data_t *p_libvlc_global = vlc_global(); 
    463462 
    464     psz_cachedir = libvlc_priv(p_this->p_libvlc)->psz_cachedir; 
    465463    if( !psz_cachedir ) /* XXX: this should never happen */ 
    466464    { 
     
    484482    snprintf( psz_filename, sizeof( psz_filename ), 
    485483              "%s"DIR_SEP"%s", psz_cachedir, CacheName() ); 
     484    free( psz_cachedir ); 
    486485    msg_Dbg( p_this, "writing plugins cache %s", psz_filename ); 
    487486