Changeset 75c438d3302e2a816a473576a35e17989d05a42c
- 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
| rd6a7e48 |
r75c438d |
|
| 240 | 240 | const char *psz_artist, const char *psz_album ) |
|---|
| 241 | 241 | { |
|---|
| | 242 | char *psz_cachedir = config_GetCacheDir(); |
|---|
| | 243 | |
|---|
| 242 | 244 | if( !EMPTY_STR(psz_artist) && !EMPTY_STR(psz_album) ) |
|---|
| 243 | 245 | { |
|---|
| 244 | 246 | char * psz_album_sanitized = ArtCacheGetSanitizedFileName( psz_album ); |
|---|
| 245 | 247 | char * psz_artist_sanitized = ArtCacheGetSanitizedFileName( psz_artist ); |
|---|
| 246 | | |
|---|
| 247 | 248 | snprintf( psz_dir, PATH_MAX, "%s" DIR_SEP |
|---|
| 248 | 249 | "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 ); |
|---|
| 251 | 251 | free( psz_album_sanitized ); |
|---|
| 252 | 252 | free( psz_artist_sanitized ); |
|---|
| … | … | |
| 257 | 257 | snprintf( psz_dir, PATH_MAX, "%s" DIR_SEP |
|---|
| 258 | 258 | "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 ); |
|---|
| 261 | 260 | free( psz_title_sanitized ); |
|---|
| 262 | 261 | } |
|---|
| | 262 | free( psz_cachedir ); |
|---|
| 263 | 263 | } |
|---|
| 264 | 264 | |
|---|
| rcb47bc0 |
r75c438d |
|
| 299 | 299 | priv->psz_configdir = config_GetUserConfDir(); |
|---|
| 300 | 300 | priv->psz_datadir = config_GetUserDataDir(); |
|---|
| 301 | | priv->psz_cachedir = config_GetCacheDir(); |
|---|
| 302 | 301 | priv->psz_configfile = config_GetCustomConfigFile( p_libvlc ); |
|---|
| 303 | 302 | |
|---|
| … | … | |
| 1065 | 1064 | free( priv->psz_configdir ); |
|---|
| 1066 | 1065 | free( priv->psz_datadir ); |
|---|
| 1067 | | free( priv->psz_cachedir ); |
|---|
| 1068 | 1066 | FREENULL( priv->psz_configfile ); |
|---|
| 1069 | 1067 | var_DelCallback( p_libvlc, "key-pressed", vlc_key_to_action, |
|---|
| rd6a7e48 |
r75c438d |
|
| 214 | 214 | char *psz_configdir; ///< user configuration directory |
|---|
| 215 | 215 | char *psz_datadir; ///< user data directory |
|---|
| 216 | | char *psz_cachedir; ///< user cache directory |
|---|
| 217 | 216 | |
|---|
| 218 | 217 | /* There is no real reason to keep a list of items, but not to break |
|---|
| rd6a7e48 |
r75c438d |
|
| 97 | 97 | void CacheLoad( vlc_object_t *p_this ) |
|---|
| 98 | 98 | { |
|---|
| 99 | | char *psz_filename, *psz_cachedir; |
|---|
| | 99 | char *psz_filename, *psz_cachedir = config_GetCacheDir(); |
|---|
| 100 | 100 | FILE *file; |
|---|
| 101 | 101 | int i, j, i_size, i_read; |
|---|
| … | … | |
| 107 | 107 | libvlc_global_data_t *p_libvlc_global = vlc_global(); |
|---|
| 108 | 108 | |
|---|
| 109 | | psz_cachedir = libvlc_priv(p_this->p_libvlc)->psz_cachedir; |
|---|
| 110 | 109 | if( !psz_cachedir ) /* XXX: this should never happen */ |
|---|
| 111 | 110 | { |
|---|
| … | … | |
| 116 | 115 | i_size = asprintf( &psz_filename, "%s"DIR_SEP"%s", |
|---|
| 117 | 116 | psz_cachedir, CacheName() ); |
|---|
| | 117 | free( psz_cachedir ); |
|---|
| 118 | 118 | if( i_size <= 0 ) |
|---|
| 119 | 119 | { |
|---|
| 120 | | msg_Err( p_this, "out of memory" ); |
|---|
| 121 | 120 | return; |
|---|
| 122 | 121 | } |
|---|
| … | … | |
| 455 | 454 | "# http://www.brynosaurus.com/cachedir/\r\n"; |
|---|
| 456 | 455 | |
|---|
| 457 | | char *psz_cachedir; |
|---|
| | 456 | char *psz_cachedir = config_GetCacheDir(); |
|---|
| 458 | 457 | FILE *file; |
|---|
| 459 | 458 | int i, j, i_cache; |
|---|
| … | … | |
| 462 | 461 | libvlc_global_data_t *p_libvlc_global = vlc_global(); |
|---|
| 463 | 462 | |
|---|
| 464 | | psz_cachedir = libvlc_priv(p_this->p_libvlc)->psz_cachedir; |
|---|
| 465 | 463 | if( !psz_cachedir ) /* XXX: this should never happen */ |
|---|
| 466 | 464 | { |
|---|
| … | … | |
| 484 | 482 | snprintf( psz_filename, sizeof( psz_filename ), |
|---|
| 485 | 483 | "%s"DIR_SEP"%s", psz_cachedir, CacheName() ); |
|---|
| | 484 | free( psz_cachedir ); |
|---|
| 486 | 485 | msg_Dbg( p_this, "writing plugins cache %s", psz_filename ); |
|---|
| 487 | 486 | |
|---|