Commit 667fa456 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

cdda: kill config_Get*

parent a689b532
...@@ -612,11 +612,14 @@ static cddb_disc_t *GetCDDBInfo( access_t *p_access, int i_titles, int *p_sector ...@@ -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" ); char *psz_tmp = var_InheritString( p_access, "cddb-server" );
cddb_set_server_name( p_cddb, psz_tmp ); if( psz_tmp )
free( 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@videolan.org" ); cddb_set_email_address( p_cddb, "vlc@videolan.org" );
...@@ -624,7 +627,7 @@ static cddb_disc_t *GetCDDBInfo( access_t *p_access, int i_titles, int *p_sector ...@@ -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_disable( p_cddb );
// cddb_cache_set_dir( p_cddb, // cddb_cache_set_dir( p_cddb,
// config_GetPsz( p_access, // var_InheritString( p_access,
// MODULE_STRING "-cddb-cachedir") ); // MODULE_STRING "-cddb-cachedir") );
cddb_set_timeout( p_cddb, 10 ); cddb_set_timeout( p_cddb, 10 );
......
...@@ -641,16 +641,16 @@ int CDDAOpen( vlc_object_t *p_this ) ...@@ -641,16 +641,16 @@ int CDDAOpen( vlc_object_t *p_this )
cddb_log_set_handler ( cddb_log_handler ); cddb_log_set_handler ( cddb_log_handler );
p_cdda->cddb.disc = NULL; p_cdda->cddb.disc = NULL;
p_cdda->b_cddb_enabled = p_cdda->b_cddb_enabled =
var_CreateGetInteger( p_access, "album-art" ) != ALBUM_ART_WHEN_ASKED && var_CreateGetInteger( p_access, "album-art" ) != ALBUM_ART_WHEN_ASKED
config_GetInt( p_access, MODULE_STRING "-cddb-enabled" ); && var_InheritInteger( p_access, MODULE_STRING "-cddb-enabled" );
#endif #endif
p_cdda->b_cdtext = 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 = 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 #if LIBCDIO_VERSION_NUM >= 73
p_cdda->b_audio_ctl = p_cdda->b_audio_ctl =
config_GetInt( p_access, MODULE_STRING "-analog-output" ); var_InheritInteger( p_access, MODULE_STRING "-analog-output" );
#endif #endif
p_cdda->psz_source = strdup( psz_source ); p_cdda->psz_source = strdup( psz_source );
...@@ -658,10 +658,11 @@ int CDDAOpen( vlc_object_t *p_this ) ...@@ -658,10 +658,11 @@ int CDDAOpen( vlc_object_t *p_this )
p_cdda->p_cdio = p_cdio; p_cdda->p_cdio = p_cdio;
p_cdda->i_tracks = 0; p_cdda->i_tracks = 0;
p_cdda->i_titles = 0; p_cdda->i_titles = 0;
p_cdda->i_debug = config_GetInt( p_this, MODULE_STRING "-debug" ); p_cdda->i_debug = var_InheritInteger( p_this, MODULE_STRING "-debug" );
p_cdda->b_nav_mode = config_GetInt(p_this, MODULE_STRING "-navigation-mode" ); p_cdda->b_nav_mode =
var_InheritInteger(p_this, MODULE_STRING "-navigation-mode" );
p_cdda->i_blocks_per_read = 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 = p_cdda->last_disc_frame =
cdio_get_track_lsn( p_cdio, CDIO_CDROM_LEADOUT_TRACK ); cdio_get_track_lsn( p_cdio, CDIO_CDROM_LEADOUT_TRACK );
p_cdda->p_input = access_GetParentInput( p_access ); p_cdda->p_input = access_GetParentInput( p_access );
...@@ -729,11 +730,11 @@ int CDDAOpen( vlc_object_t *p_this ) ...@@ -729,11 +730,11 @@ int CDDAOpen( vlc_object_t *p_this )
#if LIBCDIO_VERSION_NUM >= 72 #if LIBCDIO_VERSION_NUM >= 72
{ {
char *psz_paranoia = config_GetPsz( p_access, char *psz_paranoia = var_InheritString( p_access,
MODULE_STRING "-paranoia" ); MODULE_STRING "-paranoia" );
p_cdda->e_paranoia = PARANOIA_MODE_DISABLE; p_cdda->e_paranoia = PARANOIA_MODE_DISABLE;
if( psz_paranoia && *psz_paranoia ) if( psz_paranoia )
{ {
if( !strncmp( psz_paranoia, "full", strlen("full") ) ) if( !strncmp( psz_paranoia, "full", strlen("full") ) )
p_cdda->e_paranoia = PARANOIA_MODE_FULL; p_cdda->e_paranoia = PARANOIA_MODE_FULL;
......
...@@ -69,38 +69,44 @@ GetCDDBInfo( access_t *p_access, cdda_data_t *p_cdda ) ...@@ -69,38 +69,44 @@ GetCDDBInfo( access_t *p_access, cdda_data_t *p_cdda )
goto cddb_destroy; goto cddb_destroy;
} }
char* psz_email = config_GetPsz( p_access, MODULE_STRING "-cddb-email"); char* psz_email = var_InheritString( p_access, MODULE_STRING "-cddb-email");
char* psz_srv_name = config_GetPsz( p_access, MODULE_STRING "-cddb-server"); if( psz_email )
cddb_set_email_address( conn, psz_email ); {
cddb_set_server_name( conn, psz_srv_name ); 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, cddb_set_server_port(conn,
config_GetInt( p_access, var_InheritInteger( p_access,
MODULE_STRING "-cddb-port") ); MODULE_STRING "-cddb-port") );
free( psz_email );
free( psz_srv_name );
/* Set the location of the local CDDB cache directory. /* Set the location of the local CDDB cache directory.
The default location of this directory is */ 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); cddb_cache_disable(conn);
char* psz_cache = config_GetPsz( p_access, MODULE_STRING "-cddb-cachedir"); char* psz_cache = var_InheritString( p_access, MODULE_STRING "-cddb-cachedir");
cddb_cache_set_dir(conn, psz_cache ); if( psz_cache )
free( psz_cache ); {
cddb_cache_set_dir(conn, psz_cache );
free( psz_cache );
}
cddb_set_timeout(conn, 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); cddb_http_enable(conn);
}
else else
{
cddb_http_disable(conn); cddb_http_disable(conn);
}
p_cdda->cddb.disc = cddb_disc_new(); p_cdda->cddb.disc = cddb_disc_new();
...@@ -794,10 +800,13 @@ CDDAFormatTitle( const access_t *p_access, track_t i_track ) ...@@ -794,10 +800,13 @@ CDDAFormatTitle( const access_t *p_access, track_t i_track )
config_varname = MODULE_STRING "-cddb-title-format"; config_varname = MODULE_STRING "-cddb-title-format";
} }
#endif /*HAVE_LIBCDDB*/ #endif /*HAVE_LIBCDDB*/
char* psz_config_varname = config_GetPsz( p_access, config_varname ); char* psz_config_varname = var_InheritString( p_access, config_varname );
psz_name = CDDAFormatStr( p_access, p_cdda, psz_config_varname, if( psz_config_varname )
psz_mrl, i_track ); {
free( psz_config_varname ); psz_name = CDDAFormatStr( p_access, p_cdda, psz_config_varname,
psz_mrl, i_track );
free( psz_config_varname );
}
free( psz_mrl ); free( psz_mrl );
return psz_name; return psz_name;
} }
...@@ -817,7 +826,7 @@ CDDAFixupPlaylist( access_t *p_access, cdda_data_t *p_cdda, ...@@ -817,7 +826,7 @@ CDDAFixupPlaylist( access_t *p_access, cdda_data_t *p_cdda,
#ifdef HAVE_LIBCDDB #ifdef HAVE_LIBCDDB
p_cdda->b_cddb_enabled = 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 ) if( b_single_track && !p_cdda->b_cddb_enabled )
return VLC_SUCCESS; return VLC_SUCCESS;
#else #else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment