[vlc-commits] input: move variables initialization

Thomas Guillem git at videolan.org
Wed Jul 18 18:07:03 CEST 2018


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Jul 18 16:36:17 2018 +0200| [a451247f62cbe41d066ff5f8f7f8b0ce0dc0c1ff] | committer: Thomas Guillem

input: move variables initialization

Move these 4 variables from input_LegacyVarInit() to input_ConfigVarInit()
Indeed, these variables are needed, as read-only, for input_thread or the
es_out initialization.

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

 src/input/input.c |  2 +-
 src/input/var.c   | 13 +++++--------
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/src/input/input.c b/src/input/input.c
index f5a7c207c4..d542d53238 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -1339,7 +1339,7 @@ static int Init( input_thread_t * p_input )
         LoadSlaves( p_input );
         InitPrograms( p_input );
 
-        double f_rate = var_InheritFloat( p_input, "rate" );
+        double f_rate = var_GetFloat( p_input, "rate" );
         if( f_rate != 0.0 && f_rate != 1.0 )
         {
             vlc_value_t val = { .i_int = INPUT_RATE_DEFAULT / f_rate };
diff --git a/src/input/var.c b/src/input/var.c
index ecab7011ff..37af8e877c 100644
--- a/src/input/var.c
+++ b/src/input/var.c
@@ -441,9 +441,6 @@ void input_LegacyVarInit ( input_thread_t *p_input )
     val.i_int = input_priv(p_input)->i_state;
     var_Change( p_input, "state", VLC_VAR_SETVALUE, val );
 
-    /* Rate */
-    var_Create( p_input, "rate", VLC_VAR_FLOAT | VLC_VAR_DOINHERIT );
-
     var_Create( p_input, "frame-next", VLC_VAR_VOID );
 
     /* Position */
@@ -458,14 +455,12 @@ void input_LegacyVarInit ( input_thread_t *p_input )
     var_Change( p_input, "bookmark", VLC_VAR_SETTEXT, _("Bookmark") );
 
     /* Program */
-    var_Create( p_input, "program", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
     var_Get( p_input, "program", &val );
     if( val.i_int <= 0 )
         var_Change( p_input, "program", VLC_VAR_DELCHOICE, val );
     var_Change( p_input, "program", VLC_VAR_SETTEXT, _("Program") );
 
     /* Programs */
-    var_Create( p_input, "programs", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
     var_Change( p_input, "programs", VLC_VAR_SETTEXT, _("Programs") );
 
     /* Title */
@@ -501,9 +496,6 @@ void input_LegacyVarInit ( input_thread_t *p_input )
     var_Create( p_input, "spu-choice", VLC_VAR_INTEGER );
     var_SetInteger( p_input, "spu-choice", -1 );
 
-    /* Special read only objects variables for intf */
-    var_Create( p_input, "bookmarks", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
-
     var_Create( p_input, "length", VLC_VAR_INTEGER );
 
     var_Create( p_input, "bit-rate", VLC_VAR_INTEGER );
@@ -745,6 +737,11 @@ void input_ConfigVarInit ( input_thread_t *p_input )
                     VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
         var_Create( p_input, "clock-synchro",
                     VLC_VAR_INTEGER | VLC_VAR_DOINHERIT);
+
+        var_Create( p_input, "bookmarks", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
+        var_Create( p_input, "programs", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
+        var_Create( p_input, "program", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
+        var_Create( p_input, "rate", VLC_VAR_FLOAT | VLC_VAR_DOINHERIT );
     }
 
     /* */



More information about the vlc-commits mailing list