[vlc-devel] commit: cdda: kill config_Get* ( Rémi Denis-Courmont )
git version control
git at videolan.org
Wed Dec 30 19:39:43 CET 2009
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Dec 30 20:12:25 2009 +0200| [667fa4568c94476c992343ce04827869f606c41d] | committer: Rémi Denis-Courmont
cdda: kill config_Get*
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=667fa4568c94476c992343ce04827869f606c41d
---
modules/access/cdda.c | 13 ++++++----
modules/access/cdda/access.c | 21 ++++++++--------
modules/access/cdda/info.c | 53 ++++++++++++++++++++++++-----------------
3 files changed, 50 insertions(+), 37 deletions(-)
diff --git a/modules/access/cdda.c b/modules/access/cdda.c
index 8466c74..502647a 100644
--- a/modules/access/cdda.c
+++ b/modules/access/cdda.c
@@ -612,11 +612,14 @@ static cddb_disc_t *GetCDDBInfo( access_t *p_access, int i_titles, int *p_sector
}
/* */
- char *psz_tmp = config_GetPsz( p_access, "cddb-server" );
- cddb_set_server_name( p_cddb, psz_tmp );
- free( psz_tmp );
+ char *psz_tmp = var_InheritString( p_access, "cddb-server" );
+ if( psz_tmp )
+ {
+ cddb_set_server_name( p_cddb, psz_tmp );
+ free( psz_tmp );
+ }
- cddb_set_server_port( p_cddb, config_GetInt( p_access, "cddb-port" ) );
+ cddb_set_server_port( p_cddb, var_InheritInteger( p_access, "cddb-port" ) );
cddb_set_email_address( p_cddb, "vlc at videolan.org" );
@@ -624,7 +627,7 @@ static cddb_disc_t *GetCDDBInfo( access_t *p_access, int i_titles, int *p_sector
cddb_cache_disable( p_cddb );
// cddb_cache_set_dir( p_cddb,
-// config_GetPsz( p_access,
+// var_InheritString( p_access,
// MODULE_STRING "-cddb-cachedir") );
cddb_set_timeout( p_cddb, 10 );
diff --git a/modules/access/cdda/access.c b/modules/access/cdda/access.c
index 29d14d2..f89482c 100644
--- a/modules/access/cdda/access.c
+++ b/modules/access/cdda/access.c
@@ -641,16 +641,16 @@ int CDDAOpen( vlc_object_t *p_this )
cddb_log_set_handler ( cddb_log_handler );
p_cdda->cddb.disc = NULL;
p_cdda->b_cddb_enabled =
- var_CreateGetInteger( p_access, "album-art" ) != ALBUM_ART_WHEN_ASKED &&
- config_GetInt( p_access, MODULE_STRING "-cddb-enabled" );
+ var_CreateGetInteger( p_access, "album-art" ) != ALBUM_ART_WHEN_ASKED
+ && var_InheritInteger( p_access, MODULE_STRING "-cddb-enabled" );
#endif
p_cdda->b_cdtext =
- config_GetInt( p_access, MODULE_STRING "-cdtext-enabled" );
+ var_InheritInteger( p_access, MODULE_STRING "-cdtext-enabled" );
p_cdda->b_cdtext_prefer =
- config_GetInt( p_access, MODULE_STRING "-cdtext-prefer" );
+ var_InheritInteger( p_access, MODULE_STRING "-cdtext-prefer" );
#if LIBCDIO_VERSION_NUM >= 73
p_cdda->b_audio_ctl =
- config_GetInt( p_access, MODULE_STRING "-analog-output" );
+ var_InheritInteger( p_access, MODULE_STRING "-analog-output" );
#endif
p_cdda->psz_source = strdup( psz_source );
@@ -658,10 +658,11 @@ int CDDAOpen( vlc_object_t *p_this )
p_cdda->p_cdio = p_cdio;
p_cdda->i_tracks = 0;
p_cdda->i_titles = 0;
- p_cdda->i_debug = config_GetInt( p_this, MODULE_STRING "-debug" );
- p_cdda->b_nav_mode = config_GetInt(p_this, MODULE_STRING "-navigation-mode" );
+ p_cdda->i_debug = var_InheritInteger( p_this, MODULE_STRING "-debug" );
+ p_cdda->b_nav_mode =
+ var_InheritInteger(p_this, MODULE_STRING "-navigation-mode" );
p_cdda->i_blocks_per_read =
- config_GetInt( p_this, MODULE_STRING "-blocks-per-read" );
+ var_InheritInteger( p_this, MODULE_STRING "-blocks-per-read" );
p_cdda->last_disc_frame =
cdio_get_track_lsn( p_cdio, CDIO_CDROM_LEADOUT_TRACK );
p_cdda->p_input = access_GetParentInput( p_access );
@@ -729,11 +730,11 @@ int CDDAOpen( vlc_object_t *p_this )
#if LIBCDIO_VERSION_NUM >= 72
{
- char *psz_paranoia = config_GetPsz( p_access,
+ char *psz_paranoia = var_InheritString( p_access,
MODULE_STRING "-paranoia" );
p_cdda->e_paranoia = PARANOIA_MODE_DISABLE;
- if( psz_paranoia && *psz_paranoia )
+ if( psz_paranoia )
{
if( !strncmp( psz_paranoia, "full", strlen("full") ) )
p_cdda->e_paranoia = PARANOIA_MODE_FULL;
diff --git a/modules/access/cdda/info.c b/modules/access/cdda/info.c
index 7d5467e..2c5edd4 100644
--- a/modules/access/cdda/info.c
+++ b/modules/access/cdda/info.c
@@ -69,38 +69,44 @@ GetCDDBInfo( access_t *p_access, cdda_data_t *p_cdda )
goto cddb_destroy;
}
- char* psz_email = config_GetPsz( p_access, MODULE_STRING "-cddb-email");
- char* psz_srv_name = config_GetPsz( p_access, MODULE_STRING "-cddb-server");
- cddb_set_email_address( conn, psz_email );
- cddb_set_server_name( conn, psz_srv_name );
+ char* psz_email = var_InheritString( p_access, MODULE_STRING "-cddb-email");
+ if( psz_email )
+ {
+ cddb_set_email_address( conn, psz_email );
+ free( psz_email );
+ }
+
+ char* psz_srv_name = var_InheritString( p_access, MODULE_STRING "-cddb-server");
+ if( psz_srv_name )
+ {
+ cddb_set_server_name( conn, psz_srv_name );
+ free( psz_srv_name );
+ }
cddb_set_server_port(conn,
- config_GetInt( p_access,
+ var_InheritInteger( p_access,
MODULE_STRING "-cddb-port") );
- free( psz_email );
- free( psz_srv_name );
/* Set the location of the local CDDB cache directory.
The default location of this directory is */
- if (!config_GetInt( p_access, MODULE_STRING "-cddb-enable-cache" ))
+ if (!var_InheritInteger( p_access, MODULE_STRING "-cddb-enable-cache" ))
cddb_cache_disable(conn);
- char* psz_cache = config_GetPsz( p_access, MODULE_STRING "-cddb-cachedir");
- cddb_cache_set_dir(conn, psz_cache );
- free( psz_cache );
+ char* psz_cache = var_InheritString( p_access, MODULE_STRING "-cddb-cachedir");
+ if( psz_cache )
+ {
+ cddb_cache_set_dir(conn, psz_cache );
+ free( psz_cache );
+ }
cddb_set_timeout(conn,
- config_GetInt( p_access, MODULE_STRING "-cddb-timeout") );
+ var_InheritInteger( p_access, MODULE_STRING "-cddb-timeout") );
- if (config_GetInt( p_access, MODULE_STRING "-cddb-httpd" ) )
- {
+ if (var_InheritInteger( p_access, MODULE_STRING "-cddb-httpd" ) )
cddb_http_enable(conn);
- }
else
- {
cddb_http_disable(conn);
- }
p_cdda->cddb.disc = cddb_disc_new();
@@ -794,10 +800,13 @@ CDDAFormatTitle( const access_t *p_access, track_t i_track )
config_varname = MODULE_STRING "-cddb-title-format";
}
#endif /*HAVE_LIBCDDB*/
- char* psz_config_varname = config_GetPsz( p_access, config_varname );
- psz_name = CDDAFormatStr( p_access, p_cdda, psz_config_varname,
- psz_mrl, i_track );
- free( psz_config_varname );
+ char* psz_config_varname = var_InheritString( p_access, config_varname );
+ if( psz_config_varname )
+ {
+ psz_name = CDDAFormatStr( p_access, p_cdda, psz_config_varname,
+ psz_mrl, i_track );
+ free( psz_config_varname );
+ }
free( psz_mrl );
return psz_name;
}
@@ -817,7 +826,7 @@ CDDAFixupPlaylist( access_t *p_access, cdda_data_t *p_cdda,
#ifdef HAVE_LIBCDDB
p_cdda->b_cddb_enabled =
- config_GetInt( p_access, MODULE_STRING "-cddb-enabled" );
+ var_InheritInteger( p_access, MODULE_STRING "-cddb-enabled" );
if( b_single_track && !p_cdda->b_cddb_enabled )
return VLC_SUCCESS;
#else
More information about the vlc-devel
mailing list