Commit 295b0e07 authored by Rémi Duraffort's avatar Rémi Duraffort

Use var_Inherit* when applicable.

parent 49c2f121
...@@ -247,9 +247,9 @@ static int DemuxOpen( vlc_object_t *p_this ) ...@@ -247,9 +247,9 @@ static int DemuxOpen( vlc_object_t *p_this )
p_demux->p_sys = p_sys = calloc( 1, sizeof( demux_sys_t ) ); p_demux->p_sys = p_sys = calloc( 1, sizeof( demux_sys_t ) );
if( p_sys == NULL ) return VLC_ENOMEM; if( p_sys == NULL ) return VLC_ENOMEM;
p_sys->i_sample_rate = var_CreateGetInteger( p_demux, CFG_PREFIX "samplerate" ); p_sys->i_sample_rate = var_InheritInteger( p_demux, CFG_PREFIX "samplerate" );
p_sys->b_stereo = var_CreateGetBool( p_demux, CFG_PREFIX "stereo" ); p_sys->b_stereo = var_InheritBool( p_demux, CFG_PREFIX "stereo" );
p_sys->i_cache = var_CreateGetInteger( p_demux, CFG_PREFIX "caching" ); p_sys->i_cache = var_InheritInteger( p_demux, CFG_PREFIX "caching" );
p_sys->p_es = NULL; p_sys->p_es = NULL;
p_sys->p_block = NULL; p_sys->p_block = NULL;
p_sys->i_next_demux_date = -1; p_sys->i_next_demux_date = -1;
......
...@@ -144,7 +144,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -144,7 +144,7 @@ static int Open( vlc_object_t *p_this )
if( !p_access->psz_access || !*p_access->psz_access ) if( !p_access->psz_access || !*p_access->psz_access )
return VLC_EGENERIC; return VLC_EGENERIC;
psz_name = var_CreateGetString( p_this, "cd-audio" ); psz_name = var_InheritString( p_this, "cd-audio" );
if( !psz_name || !*psz_name ) if( !psz_name || !*psz_name )
{ {
free( psz_name ); free( psz_name );
...@@ -172,7 +172,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -172,7 +172,7 @@ static int Open( vlc_object_t *p_this )
p_sys->vcddev = vcddev; p_sys->vcddev = vcddev;
/* Do we play a single track ? */ /* Do we play a single track ? */
p_sys->i_track = var_CreateGetInteger( p_access, "cdda-track" ) - 1; p_sys->i_track = var_InheritInteger( p_access, "cdda-track" ) - 1;
if( p_sys->i_track < 0 ) if( p_sys->i_track < 0 )
{ {
...@@ -211,10 +211,10 @@ static int Open( vlc_object_t *p_this ) ...@@ -211,10 +211,10 @@ static int Open( vlc_object_t *p_this )
p_sys->waveheader.DataChunkID = VLC_FOURCC('d', 'a', 't', 'a'); p_sys->waveheader.DataChunkID = VLC_FOURCC('d', 'a', 't', 'a');
p_sys->waveheader.DataLength = 0; /* we just don't know */ p_sys->waveheader.DataLength = 0; /* we just don't know */
p_sys->i_first_sector = var_CreateGetInteger( p_access, p_sys->i_first_sector = var_InheritInteger( p_access,
"cdda-first-sector" ); "cdda-first-sector" );
p_sys->i_last_sector = var_CreateGetInteger( p_access, p_sys->i_last_sector = var_InheritInteger( p_access,
"cdda-last-sector" ); "cdda-last-sector" );
/* Tracknumber in MRL */ /* Tracknumber in MRL */
if( p_sys->i_first_sector < 0 || p_sys->i_last_sector < 0 ) if( p_sys->i_first_sector < 0 || p_sys->i_last_sector < 0 )
{ {
...@@ -606,7 +606,7 @@ static int GetTracks( access_t *p_access, input_item_t *p_current ) ...@@ -606,7 +606,7 @@ static int GetTracks( access_t *p_access, input_item_t *p_current )
#ifdef HAVE_LIBCDDB #ifdef HAVE_LIBCDDB
static cddb_disc_t *GetCDDBInfo( access_t *p_access, int i_titles, int *p_sectors ) static cddb_disc_t *GetCDDBInfo( access_t *p_access, int i_titles, int *p_sectors )
{ {
if( var_CreateGetInteger( p_access, "album-art" ) == ALBUM_ART_WHEN_ASKED ) if( var_InheritInteger( p_access, "album-art" ) == ALBUM_ART_WHEN_ASKED )
return NULL; return NULL;
/* */ /* */
......
...@@ -167,13 +167,10 @@ static int Open( vlc_object_t *p_this ) ...@@ -167,13 +167,10 @@ static int Open( vlc_object_t *p_this )
if( !p_sys ) if( !p_sys )
return VLC_ENOMEM; return VLC_ENOMEM;
p_sys->i_pts_delay = var_CreateGetInteger( p_access, "eyetv-caching" ); p_sys->i_pts_delay = var_InheritInteger( p_access, "eyetv-caching" );
int val = var_CreateGetInteger( p_access, "eyetv-channel" );
msg_Dbg( p_access, "coming up" ); msg_Dbg( p_access, "coming up" );
selectChannel( p_this, var_InheritInteger( p_access, "eyetv-channel" ) );
selectChannel( p_this, val );
/* socket */ /* socket */
memset(&publicAddr, 0, sizeof(publicAddr)); memset(&publicAddr, 0, sizeof(publicAddr));
......
...@@ -216,9 +216,9 @@ int Open( vlc_object_t *p_this ) ...@@ -216,9 +216,9 @@ int Open( vlc_object_t *p_this )
p_access->p_sys = p_sys; p_access->p_sys = p_sys;
p_sys->i_nb_reads = 0; p_sys->i_nb_reads = 0;
p_sys->fd = fd; p_sys->fd = fd;
p_sys->caching = var_CreateGetInteger (p_access, "file-caching"); p_sys->caching = var_InheritInteger (p_access, "file-caching");
if (IsRemote(fd)) if (IsRemote(fd))
p_sys->caching += var_CreateGetInteger (p_access, "network-caching"); p_sys->caching += var_InheritInteger (p_access, "network-caching");
p_sys->b_pace_control = true; p_sys->b_pace_control = true;
if (S_ISREG (st.st_mode)) if (S_ISREG (st.st_mode))
......
...@@ -156,7 +156,7 @@ static int Login( vlc_object_t *p_access, access_sys_t *p_sys ) ...@@ -156,7 +156,7 @@ static int Login( vlc_object_t *p_access, access_sys_t *p_sys )
if( p_sys->url.psz_username && *p_sys->url.psz_username ) if( p_sys->url.psz_username && *p_sys->url.psz_username )
psz = strdup( p_sys->url.psz_username ); psz = strdup( p_sys->url.psz_username );
else else
psz = var_CreateGetString( p_access, "ftp-user" ); psz = var_InheritString( p_access, "ftp-user" );
if( !psz ) if( !psz )
return -1; return -1;
...@@ -178,7 +178,7 @@ static int Login( vlc_object_t *p_access, access_sys_t *p_sys ) ...@@ -178,7 +178,7 @@ static int Login( vlc_object_t *p_access, access_sys_t *p_sys )
if( p_sys->url.psz_password && *p_sys->url.psz_password ) if( p_sys->url.psz_password && *p_sys->url.psz_password )
psz = strdup( p_sys->url.psz_password ); psz = strdup( p_sys->url.psz_password );
else else
psz = var_CreateGetString( p_access, "ftp-pwd" ); psz = var_InheritString( p_access, "ftp-pwd" );
if( !psz ) if( !psz )
return -1; return -1;
...@@ -197,7 +197,7 @@ static int Login( vlc_object_t *p_access, access_sys_t *p_sys ) ...@@ -197,7 +197,7 @@ static int Login( vlc_object_t *p_access, access_sys_t *p_sys )
break; break;
case 3: case 3:
msg_Dbg( p_access, "account needed" ); msg_Dbg( p_access, "account needed" );
psz = var_CreateGetString( p_access, "ftp-account" ); psz = var_InheritString( p_access, "ftp-account" );
if( ftp_SendCommand( p_access, p_sys, "ACCT %s", if( ftp_SendCommand( p_access, p_sys, "ACCT %s",
psz ) < 0 || psz ) < 0 ||
ftp_ReadCommand( p_access, p_sys, &i_answer, NULL ) < 0 ) ftp_ReadCommand( p_access, p_sys, &i_answer, NULL ) < 0 )
......
...@@ -88,7 +88,7 @@ static int Open (vlc_object_t *p_this) ...@@ -88,7 +88,7 @@ static int Open (vlc_object_t *p_this)
assert ((INT64_C(1) << 63) == ((off_t)(INT64_C(1) << 63))); assert ((INT64_C(1) << 63) == ((off_t)(INT64_C(1) << 63)));
if (!var_CreateGetBool (p_this, "file-mmap")) if (!var_InheritBool (p_this, "file-mmap"))
return VLC_EGENERIC; /* disabled */ return VLC_EGENERIC; /* disabled */
STANDARD_BLOCK_ACCESS_INIT; STANDARD_BLOCK_ACCESS_INIT;
......
...@@ -170,9 +170,9 @@ static int DemuxOpen( vlc_object_t *p_this ) ...@@ -170,9 +170,9 @@ static int DemuxOpen( vlc_object_t *p_this )
p_demux->p_sys = p_sys = calloc( 1, sizeof( demux_sys_t ) ); p_demux->p_sys = p_sys = calloc( 1, sizeof( demux_sys_t ) );
if( p_sys == NULL ) return VLC_ENOMEM; if( p_sys == NULL ) return VLC_ENOMEM;
p_sys->i_sample_rate = var_CreateGetInteger( p_demux, CFG_PREFIX "samplerate" ); p_sys->i_sample_rate = var_InheritInteger( p_demux, CFG_PREFIX "samplerate" );
p_sys->b_stereo = var_CreateGetBool( p_demux, CFG_PREFIX "stereo" ); p_sys->b_stereo = var_InheritBool( p_demux, CFG_PREFIX "stereo" );
p_sys->i_cache = var_CreateGetInteger( p_demux, CFG_PREFIX "caching" ); p_sys->i_cache = var_InheritInteger( p_demux, CFG_PREFIX "caching" );
p_sys->i_fd = -1; p_sys->i_fd = -1;
p_sys->p_es = NULL; p_sys->p_es = NULL;
p_sys->p_block = NULL; p_sys->p_block = NULL;
......
...@@ -560,21 +560,21 @@ static int Open( vlc_object_t * p_this ) ...@@ -560,21 +560,21 @@ static int Open( vlc_object_t * p_this )
/* defaults values */ /* defaults values */
var_Create( p_access, "pvr-caching", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT ); var_Create( p_access, "pvr-caching", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
p_sys->psz_videodev = var_CreateGetString( p_access, "pvr-device" ); p_sys->psz_videodev = var_InheritString( p_access, "pvr-device" );
p_sys->psz_radiodev = var_CreateGetString( p_access, "pvr-radio-device" ); p_sys->psz_radiodev = var_InheritString( p_access, "pvr-radio-device" );
p_sys->i_standard = var_CreateGetInteger( p_access, "pvr-norm" ); p_sys->i_standard = var_InheritInteger( p_access, "pvr-norm" );
p_sys->i_width = var_CreateGetInteger( p_access, "pvr-width" ); p_sys->i_width = var_InheritInteger( p_access, "pvr-width" );
p_sys->i_height = var_CreateGetInteger( p_access, "pvr-height" ); p_sys->i_height = var_InheritInteger( p_access, "pvr-height" );
p_sys->i_frequency = var_CreateGetInteger( p_access, "pvr-frequency" ); p_sys->i_frequency = var_InheritInteger( p_access, "pvr-frequency" );
p_sys->i_framerate = var_CreateGetInteger( p_access, "pvr-framerate" ); p_sys->i_framerate = var_InheritInteger( p_access, "pvr-framerate" );
p_sys->i_keyint = var_CreateGetInteger( p_access, "pvr-keyint" ); p_sys->i_keyint = var_InheritInteger( p_access, "pvr-keyint" );
p_sys->i_bframes = var_CreateGetInteger( p_access, "pvr-bframes" ); p_sys->i_bframes = var_InheritInteger( p_access, "pvr-bframes" );
p_sys->i_bitrate = var_CreateGetInteger( p_access, "pvr-bitrate" ); p_sys->i_bitrate = var_InheritInteger( p_access, "pvr-bitrate" );
p_sys->i_bitrate_peak = var_CreateGetInteger( p_access, "pvr-bitrate-peak" ); p_sys->i_bitrate_peak = var_InheritInteger( p_access, "pvr-bitrate-peak" );
p_sys->i_bitrate_mode = var_CreateGetInteger( p_access, "pvr-bitrate-mode" ); p_sys->i_bitrate_mode = var_InheritInteger( p_access, "pvr-bitrate-mode" );
p_sys->i_audio_bitmask = var_CreateGetInteger( p_access, "pvr-audio-bitmask" ); p_sys->i_audio_bitmask = var_InheritInteger( p_access, "pvr-audio-bitmask" );
p_sys->i_volume = var_CreateGetInteger( p_access, "pvr-audio-volume" ); p_sys->i_volume = var_InheritInteger( p_access, "pvr-audio-volume" );
p_sys->i_input = var_CreateGetInteger( p_access, "pvr-channel" ); p_sys->i_input = var_InheritInteger( p_access, "pvr-channel" );
/* parse command line options */ /* parse command line options */
psz_tofree = strdup( p_access->psz_location ); psz_tofree = strdup( p_access->psz_location );
......
...@@ -142,7 +142,7 @@ static int Open( vlc_object_t* p_this ) ...@@ -142,7 +142,7 @@ static int Open( vlc_object_t* p_this )
} }
if( url.i_port <= 0 ) if( url.i_port <= 0 )
i_port = var_CreateGetInteger( p_access, "sftp-port" ); i_port = var_InheritInteger( p_access, "sftp-port" );
else else
i_port = url.i_port; i_port = url.i_port;
...@@ -209,7 +209,7 @@ static int Open( vlc_object_t* p_this ) ...@@ -209,7 +209,7 @@ static int Open( vlc_object_t* p_this )
/* Create the two variables */ /* Create the two variables */
var_Create( p_access, "sftp-caching", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT ); var_Create( p_access, "sftp-caching", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
p_sys->i_read_size = var_CreateGetInteger( p_access, "sftp-readsize" ); p_sys->i_read_size = var_InheritInteger( p_access, "sftp-readsize" );
free( psz_password ); free( psz_password );
free( psz_username ); free( psz_username );
......
...@@ -184,11 +184,11 @@ static int Open( vlc_object_t *p_this ) ...@@ -184,11 +184,11 @@ static int Open( vlc_object_t *p_this )
/* Build an SMB URI /* Build an SMB URI
* smb://[[[domain;]user[:password@]]server[/share[/path[/file]]]] */ * smb://[[[domain;]user[:password@]]server[/share[/path[/file]]]] */
if( !psz_user ) psz_user = var_CreateGetString( p_access, "smb-user" ); if( !psz_user ) psz_user = var_InheritString( p_access, "smb-user" );
if( psz_user && !*psz_user ) { free( psz_user ); psz_user = NULL; } if( psz_user && !*psz_user ) { free( psz_user ); psz_user = NULL; }
if( !psz_pwd ) psz_pwd = var_CreateGetString( p_access, "smb-pwd" ); if( !psz_pwd ) psz_pwd = var_InheritString( p_access, "smb-pwd" );
if( psz_pwd && !*psz_pwd ) { free( psz_pwd ); psz_pwd = NULL; } if( psz_pwd && !*psz_pwd ) { free( psz_pwd ); psz_pwd = NULL; }
if( !psz_domain ) psz_domain = var_CreateGetString( p_access, "smb-domain" ); if( !psz_domain ) psz_domain = var_InheritString( p_access, "smb-domain" );
if( psz_domain && !*psz_domain ) { free( psz_domain ); psz_domain = NULL; } if( psz_domain && !*psz_domain ) { free( psz_domain ); psz_domain = NULL; }
#ifdef WIN32 #ifdef WIN32
......
...@@ -110,7 +110,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -110,7 +110,7 @@ static int Open( vlc_object_t *p_this )
} }
} }
i_bind_port = var_CreateGetInteger( p_access, "server-port" ); i_bind_port = var_InheritInteger( p_access, "server-port" );
/* Parse psz_name syntax : /* Parse psz_name syntax :
* [serveraddr[:serverport]][@[bindaddr]:[bindport]] */ * [serveraddr[:serverport]][@[bindaddr]:[bindport]] */
......
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