From: RĂ©mi Denis-Courmont Date: Sat, 23 Jan 2010 17:45:13 +0000 (+0200) Subject: misc: use var_Inherit X-Git-Tag: 1.1.0-ff~1008 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=cdf54698d550094988f073f2d1caf9abf0b627df;p=vlc misc: use var_Inherit --- diff --git a/modules/control/globalhotkeys/win32.c b/modules/control/globalhotkeys/win32.c index e73bfcbd10..e5baeaf2be 100644 --- a/modules/control/globalhotkeys/win32.c +++ b/modules/control/globalhotkeys/win32.c @@ -175,7 +175,7 @@ static void *Thread( void *p_data ) if( asprintf( &psz_hotkey, "global-%s", p_hotkey->psz_action ) < 0 ) break; - i_key = config_GetInt( p_intf, psz_hotkey ); + i_key = var_InheritInteger( p_intf, psz_hotkey ); free( psz_hotkey ); diff --git a/modules/control/globalhotkeys/xcb.c b/modules/control/globalhotkeys/xcb.c index d31af2cc2a..4049e63d75 100644 --- a/modules/control/globalhotkeys/xcb.c +++ b/modules/control/globalhotkeys/xcb.c @@ -344,7 +344,7 @@ static bool Mapping( intf_thread_t *p_intf ) break; const int i_vlc_action = p_hotkey->i_action; - const int i_vlc_key = config_GetInt( p_intf, psz_hotkey ); + const int i_vlc_key = var_InheritInteger( p_intf, psz_hotkey ); free( psz_hotkey ); if( !i_vlc_key ) diff --git a/modules/meta_engine/folder.c b/modules/meta_engine/folder.c index fbb96190ca..ae98de9438 100644 --- a/modules/meta_engine/folder.c +++ b/modules/meta_engine/folder.c @@ -113,7 +113,7 @@ static int FindMeta( vlc_object_t *p_this ) { if( i == -1 ) /* higher priority : configured filename */ { - char *psz_userfile = config_GetPsz( p_this, "album-art-filename" ); + char *psz_userfile = var_InheritString( p_this, "album-art-filename" ); if( !psz_userfile ) continue; snprintf( psz_filename, MAX_PATH, "%s%s", psz_path, psz_userfile ); diff --git a/modules/misc/audioscrobbler.c b/modules/misc/audioscrobbler.c index bae7d6c0ce..fa359489ad 100644 --- a/modules/misc/audioscrobbler.c +++ b/modules/misc/audioscrobbler.c @@ -731,11 +731,11 @@ static int Handshake( intf_thread_t *p_this ) intf_thread_t *p_intf = ( intf_thread_t* ) p_this; intf_sys_t *p_sys = p_this->p_sys; - psz_username = config_GetPsz( p_this, "lastfm-username" ); + psz_username = var_InheritString( p_this, "lastfm-username" ); if( !psz_username ) return VLC_ENOMEM; - psz_password = config_GetPsz( p_this, "lastfm-password" ); + psz_password = var_InheritString( p_this, "lastfm-password" ); if( !psz_password ) { free( psz_username ); @@ -788,7 +788,7 @@ static int Handshake( intf_thread_t *p_this ) strncpy( p_sys->psz_auth_token, psz_auth_token, 33 ); free( psz_auth_token ); - psz_scrobbler_url = config_GetPsz( p_this, "scrobbler-url" ); + psz_scrobbler_url = var_InheritString( p_this, "scrobbler-url" ); if( !psz_scrobbler_url ) { free( psz_username ); diff --git a/modules/misc/dummy/interface.c b/modules/misc/dummy/interface.c index 3843dd8a28..11e46889b9 100644 --- a/modules/misc/dummy/interface.c +++ b/modules/misc/dummy/interface.c @@ -43,7 +43,7 @@ int OpenIntf ( vlc_object_t *p_this ) #ifdef WIN32 bool b_quiet; - b_quiet = config_GetInt( p_intf, "dummy-quiet" ); + b_quiet = var_InheritBool( p_intf, "dummy-quiet" ); if( !b_quiet ) CONSOLE_INTRO_MSG; #endif diff --git a/modules/misc/freetype.c b/modules/misc/freetype.c index ca49cbc749..c448b1b816 100644 --- a/modules/misc/freetype.c +++ b/modules/misc/freetype.c @@ -1348,7 +1348,7 @@ static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out, p_region_out->i_x = p_region_in->i_x; p_region_out->i_y = p_region_in->i_y; - if( config_GetInt( p_filter, "freetype-yuvp" ) ) + if( var_InheritBool( p_filter, "freetype-yuvp" ) ) Render( p_filter, p_region_out, p_lines, result.x, result.y ); else RenderYUVA( p_filter, p_region_out, p_lines, result.x, result.y ); @@ -2320,7 +2320,7 @@ static int RenderHtml( filter_t *p_filter, subpicture_region_t *p_region_out, */ if(( rv == VLC_SUCCESS ) && ( i_len > 0 )) { - if( config_GetInt( p_filter, "freetype-yuvp" ) ) + if( var_InheritBool( p_filter, "freetype-yuvp" ) ) { Render( p_filter, p_region_out, p_lines, result.x, result.y ); diff --git a/modules/misc/gnutls.c b/modules/misc/gnutls.c index 2b8658e401..132eb5b713 100644 --- a/modules/misc/gnutls.c +++ b/modules/misc/gnutls.c @@ -976,7 +976,7 @@ gnutls_ServerSessionPrepare( tls_server_t *p_server ) gnutls_certificate_server_set_request (session, GNUTLS_CERT_REQUIRE); /* Session resumption support */ - i_val = config_GetInt (p_server, "gnutls-cache-timeout"); + i_val = var_InheritInteger (p_server, "gnutls-cache-timeout"); if (i_val >= 0) gnutls_db_set_cache_expiration (session, i_val); gnutls_db_set_retrieve_function( session, cb_fetch ); @@ -1077,7 +1077,7 @@ static int OpenServer (vlc_object_t *obj) if( p_sys == NULL ) return VLC_ENOMEM; - p_sys->i_cache_size = config_GetInt (obj, "gnutls-cache-size"); + p_sys->i_cache_size = var_InheritInteger (obj, "gnutls-cache-size"); if (p_sys->i_cache_size == -1) /* Duh, config subsystem exploded?! */ p_sys->i_cache_size = 0; p_sys->p_cache = calloc (p_sys->i_cache_size, diff --git a/modules/misc/logger.c b/modules/misc/logger.c index be1cec2fdf..ddc7f35983 100644 --- a/modules/misc/logger.c +++ b/modules/misc/logger.c @@ -232,7 +232,7 @@ static int Open( vlc_object_t *p_this ) if( p_sys->msg.i_mode != MODE_SYSLOG ) { - char *psz_file = config_GetPsz( p_intf, "logfile" ); + char *psz_file = var_InheritString( p_intf, "logfile" ); if( !psz_file ) { #ifdef __APPLE__ diff --git a/modules/misc/notify/growl_udp.c b/modules/misc/notify/growl_udp.c index 7ba388a579..2717a096d6 100644 --- a/modules/misc/notify/growl_udp.c +++ b/modules/misc/notify/growl_udp.c @@ -260,9 +260,9 @@ static int CheckAndSend( vlc_object_t *p_this, uint8_t* p_data, int i_offset ) int i, i_handle; struct md5_s md5; intf_thread_t *p_intf = (intf_thread_t *)p_this; - char *psz_password = config_GetPsz( p_intf, "growl-password" ); - char *psz_server = config_GetPsz( p_intf, "growl-server" ); - int i_port = config_GetInt( p_intf, "growl-port" ); + char *psz_password = var_InheritString( p_intf, "growl-password" ); + char *psz_server = var_InheritString( p_intf, "growl-server" ); + int i_port = var_InheritInteger( p_intf, "growl-port" ); strcpy( (char*)(p_data+i_offset), psz_password ); i = i_offset + strlen(psz_password); diff --git a/modules/misc/notify/msn.c b/modules/misc/notify/msn.c index 82d538ac21..afc0c71b15 100644 --- a/modules/misc/notify/msn.c +++ b/modules/misc/notify/msn.c @@ -93,7 +93,7 @@ static int Open( vlc_object_t *p_this ) if( !p_intf->p_sys ) return VLC_ENOMEM; - p_intf->p_sys->psz_format = config_GetPsz( p_intf, "msn-format" ); + p_intf->p_sys->psz_format = var_InheritString( p_intf, "msn-format" ); if( !p_intf->p_sys->psz_format ) { msg_Dbg( p_intf, "no format provided" ); diff --git a/modules/misc/notify/notify.c b/modules/misc/notify/notify.c index 9945386927..cd79bc00fd 100644 --- a/modules/misc/notify/notify.c +++ b/modules/misc/notify/notify.c @@ -307,7 +307,7 @@ static int Notify( vlc_object_t *p_this, const char *psz_temp, GdkPixbuf *pix, notification = notify_notification_new( _("Now Playing"), psz_temp, NULL, NULL ); notify_notification_set_timeout( notification, - config_GetInt(p_this, "notify-timeout") ); + var_InheritInteger(p_this, "notify-timeout") ); notify_notification_set_urgency( notification, NOTIFY_URGENCY_LOW ); if( pix ) { diff --git a/modules/misc/notify/telepathy.c b/modules/misc/notify/telepathy.c index c89c58792e..c6233ac7d5 100644 --- a/modules/misc/notify/telepathy.c +++ b/modules/misc/notify/telepathy.c @@ -112,7 +112,7 @@ static int Open( vlc_object_t *p_this ) return VLC_EGENERIC; } - p_intf->p_sys->psz_format = config_GetPsz( p_intf, "telepathy-format" ); + p_intf->p_sys->psz_format = var_InheritString( p_intf, "telepathy-format" ); if( !p_intf->p_sys->psz_format ) { msg_Dbg( p_intf, "no format provided" ); diff --git a/modules/misc/notify/xosd.c b/modules/misc/notify/xosd.c index 832ccccd24..24e0ff413e 100644 --- a/modules/misc/notify/xosd.c +++ b/modules/misc/notify/xosd.c @@ -122,8 +122,8 @@ static int Open( vlc_object_t *p_this ) return VLC_ENOMEM; /* Initialize library */ - psz_font = config_GetPsz( p_intf, "xosd-font" ); - psz_colour = config_GetPsz( p_intf, "xosd-colour" ); + psz_font = var_InheritString( p_intf, "xosd-font" ); + psz_colour = var_InheritString( p_intf, "xosd-colour" ); p_osd = xosd_create( 1 ); if( p_osd == NULL ) @@ -141,14 +141,14 @@ static int Open( vlc_object_t *p_this ) xosd_set_font( p_osd, psz_font ); xosd_set_colour( p_osd, psz_colour ); xosd_set_timeout( p_osd, 3 ); - xosd_set_pos( p_osd, config_GetInt( p_intf, "xosd-position" ) ? + xosd_set_pos( p_osd, var_InheritInteger( p_intf, "xosd-position" ) ? XOSD_bottom: XOSD_top ); xosd_set_horizontal_offset( p_osd, - config_GetInt( p_intf, "xosd-text-offset" ) ); + var_InheritInteger( p_intf, "xosd-text-offset" ) ); xosd_set_vertical_offset( p_osd, - config_GetInt( p_intf, "xosd-text-offset" ) ); + var_InheritInteger( p_intf, "xosd-text-offset" ) ); xosd_set_shadow_offset( p_osd, - config_GetInt( p_intf, "xosd-shadow-offset" )); + var_InheritInteger( p_intf, "xosd-shadow-offset" )); /* Initialize to NULL */ xosd_display( p_osd, 0, XOSD_string, "XOSD interface initialized" ); diff --git a/modules/misc/osd/simple.c b/modules/misc/osd/simple.c index 992efe90fb..cb51521c8c 100644 --- a/modules/misc/osd/simple.c +++ b/modules/misc/osd/simple.c @@ -75,7 +75,7 @@ int osd_parser_simpleOpen( vlc_object_t *p_this ) result = fscanf(fd, "%24s %255s", action, path ); /* override images path ? */ - psz_path = config_GetPsz( p_this, "osdmenu-file-path" ); + psz_path = var_InheritString( p_this, "osdmenu-file-path" ); if( psz_path ) { /* psz_path is not null and therefor path cannot be NULL diff --git a/modules/misc/svg.c b/modules/misc/svg.c index ced1c23bb5..bcf18b03b0 100644 --- a/modules/misc/svg.c +++ b/modules/misc/svg.c @@ -158,7 +158,7 @@ static char *svg_GetTemplate( vlc_object_t *p_this ) char *psz_template; FILE *file; - psz_filename = config_GetPsz( p_filter, "svg-template-file" ); + psz_filename = var_InheritString( p_filter, "svg-template-file" ); if( !psz_filename || (psz_filename[0] == 0) ) { /* No filename. Use a default value. */ diff --git a/modules/mux/asf.c b/modules/mux/asf.c index b1d498b508..64b74025e1 100644 --- a/modules/mux/asf.c +++ b/modules/mux/asf.c @@ -220,8 +220,8 @@ static int Open( vlc_object_t *p_this ) p_sys->p_tracks = vlc_array_new(); p_sys->b_write_header = true; - p_sys->i_packet_size = config_GetInt( p_mux, "sout-asf-packet-size" ); - p_sys->i_bitrate_override = config_GetInt( p_mux, "sout-asf-bitrate-override" ); + p_sys->i_packet_size = var_InheritInteger( p_mux, "sout-asf-packet-size" ); + p_sys->i_bitrate_override = var_InheritInteger( p_mux, "sout-asf-bitrate-override" ); msg_Dbg( p_mux, "Packet size %d", p_sys->i_packet_size); if (p_sys->i_bitrate_override) msg_Dbg( p_mux, "Bitrate override %"PRId64, p_sys->i_bitrate_override); diff --git a/modules/services_discovery/sap.c b/modules/services_discovery/sap.c index 1f1989941d..03fe887328 100644 --- a/modules/services_discovery/sap.c +++ b/modules/services_discovery/sap.c @@ -447,7 +447,7 @@ static void Close( vlc_object_t *p_this ) FREENULL( p_sys->pi_fd ); #if 0 - if( config_GetInt( p_sd, "sap-cache" ) ) + if( var_InheritBool( p_sd, "sap-cache" ) ) { CacheSave( p_sd ); }