Commit b3f6fae8 authored by Rémi Duraffort's avatar Rémi Duraffort

Use var_CreateGet* when applicable.

parent 5e2ff900
......@@ -93,7 +93,6 @@ static int Open( vlc_object_t * p_this )
demux_t *p_demux = (demux_t*)p_this;
demux_sys_t *p_sys;
const char *psz_mode;
vlc_value_t val;
bool b_append;
/* Accept only if forced */
......@@ -104,9 +103,7 @@ static int Open( vlc_object_t * p_this )
if( !p_sys )
return VLC_ENOMEM;
var_Create( p_demux, "demuxdump-append", VLC_VAR_BOOL|VLC_VAR_DOINHERIT );
var_Get( p_demux, "demuxdump-append", &val );
b_append = val.b_bool;
b_append = var_CreateGetBool( p_demux, "demuxdump-append" );
if ( b_append )
psz_mode = "ab";
else
......
......@@ -303,7 +303,7 @@ static int Open( vlc_object_t * p_this )
demux_sys_t *p_sys;
int i_size;
bool b_matched = false;
vlc_value_t val;
float f_fps;
p_demux->pf_control = Control;
p_demux->p_sys = p_sys = malloc( sizeof( demux_sys_t ) );
......@@ -340,8 +340,7 @@ static int Open( vlc_object_t * p_this )
}
var_Create( p_demux, "mjpeg-fps", VLC_VAR_FLOAT | VLC_VAR_DOINHERIT );
var_Get( p_demux, "mjpeg-fps", &val );
f_fps = var_CreateGetFloat( p_demux, "mjpeg-fps" );
p_sys->i_frame_length = 0;
/* Check for jpeg file extension */
......@@ -351,9 +350,9 @@ static int Open( vlc_object_t * p_this )
demux_IsPathExtension( p_demux, ".jpg" ) )
{
p_sys->b_still = true;
if( val.f_float)
if( f_fps )
{
p_sys->i_still_length = 1000000.0 / val.f_float;
p_sys->i_still_length = 1000000.0 / f_fps;
}
else
{
......@@ -361,9 +360,9 @@ static int Open( vlc_object_t * p_this )
p_sys->i_still_length = 1000000;
}
}
else if ( val.f_float )
else if ( f_fps )
{
p_sys->i_frame_length = 1000000.0 / val.f_float;
p_sys->i_frame_length = 1000000.0 / f_fps;
}
es_format_Init( &p_sys->fmt, VIDEO_ES, 0 );
......
......@@ -73,7 +73,6 @@ static int OpenDecoderCommon( vlc_object_t *p_this, bool b_force_dump )
decoder_t *p_dec = (decoder_t*)p_this;
decoder_sys_t *p_sys;
char psz_file[ PATH_MAX ];
vlc_value_t val;
/* Allocate the memory needed to store the decoder's structure */
if( ( p_dec->p_sys = p_sys =
......@@ -87,9 +86,7 @@ static int OpenDecoderCommon( vlc_object_t *p_this, bool b_force_dump )
#ifndef UNDER_CE
if( !b_force_dump )
{
var_Create( p_dec, "dummy-save-es", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
var_Get( p_dec, "dummy-save-es", &val );
b_force_dump = val.b_bool;
b_force_dump = var_CreateGetBool( p_dec, "dummy-save-es" );
}
if( b_force_dump )
{
......
......@@ -192,7 +192,6 @@ static int Open( vlc_object_t *p_this )
{
sout_mux_t *p_mux = (sout_mux_t*)p_this;
sout_mux_sys_t *p_sys;
vlc_value_t val;
int i;
msg_Dbg( p_mux, "asf muxer opened" );
......@@ -241,20 +240,11 @@ static int Open( vlc_object_t *p_this )
}
/* Meta data */
var_Get( p_mux, SOUT_CFG_PREFIX "title", &val );
p_sys->psz_title = val.psz_string;
var_Get( p_mux, SOUT_CFG_PREFIX "author", &val );
p_sys->psz_author = val.psz_string;
var_Get( p_mux, SOUT_CFG_PREFIX "copyright", &val );
p_sys->psz_copyright = val.psz_string;
var_Get( p_mux, SOUT_CFG_PREFIX "comment", &val );
p_sys->psz_comment = val.psz_string;
var_Get( p_mux, SOUT_CFG_PREFIX "rating", &val );
p_sys->psz_rating = val.psz_string;
p_sys->psz_title = var_GetString( p_mux, SOUT_CFG_PREFIX "title" );
p_sys->psz_author = var_GetString( p_mux, SOUT_CFG_PREFIX "author" );
p_sys->psz_copyright = var_GetString( p_mux, SOUT_CFG_PREFIX "copyright" );
p_sys->psz_comment = var_GetString( p_mux, SOUT_CFG_PREFIX "comment" );
p_sys->psz_rating = var_GetString( p_mux, SOUT_CFG_PREFIX "rating" );
msg_Dbg( p_mux, "meta data: title='%s', author='%s', copyright='%s', "
"comment='%s', rating='%s'",
......
......@@ -529,8 +529,7 @@ static int Open( vlc_object_t *p_this )
p_sys->i_audio_bound = 0;
p_sys->i_video_bound = 0;
var_Get( p_mux, SOUT_CFG_PREFIX "es-id-pid", &val );
p_sys->b_es_id_pid = val.b_bool;
p_sys->b_es_id_pid = var_GetBool( p_mux, SOUT_CFG_PREFIX "es-id-pid" );
var_Get( p_mux, SOUT_CFG_PREFIX "muxpmt", &val );
/*
......
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