]> git.sesse.net Git - vlc/commitdiff
Use var_Type to test for the existence of a variable (even more for a void variable).
authorRémi Duraffort <ivoire@videolan.org>
Fri, 5 Mar 2010 07:24:29 +0000 (08:24 +0100)
committerRémi Duraffort <ivoire@videolan.org>
Fri, 5 Mar 2010 07:24:29 +0000 (08:24 +0100)
Should fix #3385

src/input/var.c

index 9b919b636d2f315fb565052ee6b6ca6b89792536..781ce7c10287a12f2b16ce3517c067f04cba4e98 100644 (file)
@@ -359,7 +359,7 @@ void input_ControlVarNavigation( input_thread_t *p_input )
 void input_ControlVarTitle( input_thread_t *p_input, int i_title )
 {
     input_title_t *t = p_input->p->title[i_title];
-    vlc_value_t val, text;
+    vlc_value_t text;
     int  i;
 
     /* Create/Destroy command variables */
@@ -368,7 +368,7 @@ void input_ControlVarTitle( input_thread_t *p_input, int i_title )
         var_Destroy( p_input, "next-chapter" );
         var_Destroy( p_input, "prev-chapter" );
     }
-    else if( var_Get( p_input, "next-chapter", &val ) != VLC_SUCCESS )
+    else if( var_Type( p_input, "next-chapter" ) == 0 )
     {
         var_Create( p_input, "next-chapter", VLC_VAR_VOID );
         text.psz_string = _("Next chapter");
@@ -385,6 +385,7 @@ void input_ControlVarTitle( input_thread_t *p_input, int i_title )
     var_Change( p_input, "chapter", VLC_VAR_CLEARCHOICES, NULL, NULL );
     for( i = 0; i <  t->i_seekpoint; i++ )
     {
+        vlc_value_t val;
         val.i_int = i;
 
         if( t->seekpoint[i]->psz_name == NULL ||