[vlc-devel] commit: Use var_Get* when applicable. ( Rémi Duraffort )

git version control git at videolan.org
Mon Nov 16 20:14:19 CET 2009


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Sat Nov 14 11:53:31 2009 +0100| [5cde6e7779c31c79bd89e6a71d88c0f6c3f9afb2] | committer: Rémi Duraffort 

Use var_Get* when applicable.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5cde6e7779c31c79bd89e6a71d88c0f6c3f9afb2
---

 modules/mux/mpeg/ts.c |   27 +++++++++------------------
 1 files changed, 9 insertions(+), 18 deletions(-)

diff --git a/modules/mux/mpeg/ts.c b/modules/mux/mpeg/ts.c
index cc61ca8..5ddf023 100644
--- a/modules/mux/mpeg/ts.c
+++ b/modules/mux/mpeg/ts.c
@@ -650,8 +650,7 @@ static int Open( vlc_object_t *p_this )
     p_sys->b_sdt = false;
 #endif
 
-    var_Get( p_mux, SOUT_CFG_PREFIX "alignment", &val );
-    p_sys->b_data_alignment = val.b_bool;
+    p_sys->b_data_alignment = var_GetBool( p_mux, SOUT_CFG_PREFIX "alignment" );
 
     var_Get( p_mux, SOUT_CFG_PREFIX "program-pmt", &val );
     if( val.psz_string && *val.psz_string )
@@ -705,22 +704,19 @@ static int Open( vlc_object_t *p_this )
 
     p_sys->i_pid_free = p_sys->pmt[p_sys->i_num_pmt - 1].i_pid + 1;
 
-    var_Get( p_mux, SOUT_CFG_PREFIX "pid-video", &val );
-    p_sys->i_pid_video = val.i_int;
+    p_sys->i_pid_video = var_GetInteger( p_mux, SOUT_CFG_PREFIX "pid-video" );
     if ( p_sys->i_pid_video > p_sys->i_pid_free )
     {
         p_sys->i_pid_free = p_sys->i_pid_video + 1;
     }
 
-    var_Get( p_mux, SOUT_CFG_PREFIX "pid-audio", &val );
-    p_sys->i_pid_audio = val.i_int;
+    p_sys->i_pid_audio = var_GetInteger( p_mux, SOUT_CFG_PREFIX "pid-audio" );
     if ( p_sys->i_pid_audio > p_sys->i_pid_free )
     {
         p_sys->i_pid_free = p_sys->i_pid_audio + 1;
     }
 
-    var_Get( p_mux, SOUT_CFG_PREFIX "pid-spu", &val );
-    p_sys->i_pid_spu = val.i_int;
+    p_sys->i_pid_spu = var_GetInteger( p_mux, SOUT_CFG_PREFIX "pid-spu" );
     if ( p_sys->i_pid_spu > p_sys->i_pid_free )
     {
         p_sys->i_pid_free = p_sys->i_pid_spu + 1;
@@ -734,11 +730,9 @@ static int Open( vlc_object_t *p_this )
     p_sys->i_null_continuity_counter = 0;
 
     /* Allow to create constrained stream */
-    var_Get( p_mux, SOUT_CFG_PREFIX "bmin", &val );
-    p_sys->i_bitrate_min = val.i_int;
+    p_sys->i_bitrate_min = var_GetInteger( p_mux, SOUT_CFG_PREFIX "bmin" );
 
-    var_Get( p_mux, SOUT_CFG_PREFIX "bmax", &val );
-    p_sys->i_bitrate_max = val.i_int;
+    p_sys->i_bitrate_max = var_GetInteger( p_mux, SOUT_CFG_PREFIX "bmax" );
 
     if( p_sys->i_bitrate_min > 0 && p_sys->i_bitrate_max > 0 &&
         p_sys->i_bitrate_min > p_sys->i_bitrate_max )
@@ -781,8 +775,7 @@ static int Open( vlc_object_t *p_this )
     msg_Dbg( p_mux, "shaping=%"PRId64" pcr=%"PRId64" dts_delay=%"PRId64,
              p_sys->i_shaping_delay, p_sys->i_pcr_delay, p_sys->i_dts_delay );
 
-    var_Get( p_mux, SOUT_CFG_PREFIX "use-key-frames", &val );
-    p_sys->b_use_key_frames = val.b_bool;
+    p_sys->b_use_key_frames = var_GetBool( p_mux, SOUT_CFG_PREFIX "use-key-frames" );
 
     /* for TS generation */
     p_sys->i_pcr    = 0;
@@ -847,11 +840,9 @@ static int Open( vlc_object_t *p_this )
     }
     free( val.psz_string );
 
-    var_Get( p_mux, SOUT_CFG_PREFIX "crypt-audio", &val );
-    p_sys->b_crypt_audio = val.b_bool;
+    p_sys->b_crypt_audio = var_GetBool( p_mux, SOUT_CFG_PREFIX "crypt-audio" );
 
-    var_Get( p_mux, SOUT_CFG_PREFIX "crypt-video", &val );
-    p_sys->b_crypt_video = val.b_bool;
+    p_sys->b_crypt_video = var_GetBool( p_mux, SOUT_CFG_PREFIX "crypt-video" );
 
     return VLC_SUCCESS;
 }




More information about the vlc-devel mailing list