]> git.sesse.net Git - vlc/blobdiff - src/input/var.c
SRTP: fix parser
[vlc] / src / input / var.c
index 96c9d72f93aa3b962d5130b450185e88414bf7dd..b2601073a8f2a47e0779bf653bcbff202f515ec8 100644 (file)
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
 #include <stdio.h>
 #include <stdlib.h>
 
@@ -161,6 +165,9 @@ void input_ControlVarInit ( input_thread_t *p_input )
     var_Change( p_input, "spu-delay", VLC_VAR_SETVALUE, &val, NULL );
     ADD_CALLBACK( "spu-delay", EsDelayCallback );
 
+    p_input->p->pts_adjust.auto_adjust = var_CreateGetBool(
+            p_input, "auto-adjust-pts-delay" );
+
     /* Video ES */
     var_Create( p_input, "video-es", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE );
     text.psz_string = _("Video Track");
@@ -190,12 +197,14 @@ void input_ControlVarInit ( input_thread_t *p_input )
     {
         /* Special "intf-change" variable, it allows intf to set up a callback
          * to be notified of some changes.
+         *
+         * Add rate-change to inform about rate changin
+         *
          * TODO list all changes warn by this callbacks */
         var_Create( p_input, "intf-change", VLC_VAR_BOOL );
-        var_SetBool( p_input, "intf-change", VLC_TRUE );
-
-       /* item-change variable */
-        var_Create( p_input, "item-change", VLC_VAR_INTEGER );
+        var_SetBool( p_input, "intf-change", true );
+        var_Create( p_input, "rate-change", VLC_VAR_BOOL );
+        var_SetBool( p_input, "rate-change", true );
     }
 #undef ADD_CALLBACK
 }
@@ -322,7 +331,7 @@ void input_ControlVarNavigation( input_thread_t *p_input )
 
             var_Change( p_input, val.psz_string, VLC_VAR_ADDCHOICE,
                         &val2, &text2 );
-            if( text2.psz_string ) free( text2.psz_string );
+            free( text2.psz_string );
         }
 
     }
@@ -380,7 +389,7 @@ void input_ControlVarTitle( input_thread_t *p_input, int i_title )
         }
 
         var_Change( p_input, "chapter", VLC_VAR_ADDCHOICE, &val, &text );
-        if( text.psz_string ) free( text.psz_string );
+        free( text.psz_string );
     }
 }
 
@@ -448,13 +457,12 @@ void input_ConfigVarInit ( input_thread_t *p_input )
                     VLC_VAR_INTEGER | VLC_VAR_DOINHERIT);
     }
 
-    var_Create( p_input, "demuxed-id3", VLC_VAR_BOOL ); /* FIXME beurk */
-    val.b_bool = VLC_FALSE;
-    var_Change( p_input, "demuxed-id3", VLC_VAR_SETVALUE, &val, NULL );
-
     var_Create( p_input, "seekable", VLC_VAR_BOOL );
-    val.b_bool = VLC_TRUE; /* Fixed later*/
+    val.b_bool = true; /* Fixed later*/
     var_Change( p_input, "seekable", VLC_VAR_SETVALUE, &val, NULL );
+    var_Create( p_input, "can-pause", VLC_VAR_BOOL );
+    val.b_bool = true; /* Fixed later*/
+    var_Change( p_input, "can-pause", VLC_VAR_SETVALUE, &val, NULL );
 
     /* */
     var_Create( p_input, "access-filter", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
@@ -480,7 +488,7 @@ static int StateCallback( vlc_object_t *p_this, char const *psz_cmd,
                           void *p_data )
 {
     input_thread_t *p_input = (input_thread_t*)p_this;
-    (void)psz_cmd; (void)oldval; (void)p_data;
+    VLC_UNUSED(psz_cmd); VLC_UNUSED(oldval); VLC_UNUSED(p_data);
 
     if( newval.i_int == PLAYING_S || newval.i_int == PAUSE_S )
     {
@@ -495,7 +503,7 @@ static int RateCallback( vlc_object_t *p_this, char const *psz_cmd,
                          vlc_value_t oldval, vlc_value_t newval, void *p_data )
 {
     input_thread_t *p_input = (input_thread_t*)p_this;
-    (void)oldval; (void)p_data;
+    VLC_UNUSED(oldval); VLC_UNUSED(p_data);
 
     /* Problem with this way: the "rate" variable is update after the input thread do the change */
     if( !strcmp( psz_cmd, "rate-slower" ) )
@@ -520,7 +528,7 @@ static int PositionCallback( vlc_object_t *p_this, char const *psz_cmd,
 {
     input_thread_t *p_input = (input_thread_t*)p_this;
     vlc_value_t val, length;
-    (void)oldval; (void)p_data;
+    VLC_UNUSED(oldval); VLC_UNUSED(p_data);
 
     if( !strcmp( psz_cmd, "position-offset" ) )
     {
@@ -553,7 +561,7 @@ static int TimeCallback( vlc_object_t *p_this, char const *psz_cmd,
 {
     input_thread_t *p_input = (input_thread_t*)p_this;
     vlc_value_t val, length;
-    (void)oldval; (void)p_data;
+    VLC_UNUSED(oldval); VLC_UNUSED(p_data);
 
     if( !strcmp( psz_cmd, "time-offset" ) )
     {
@@ -585,7 +593,7 @@ static int ProgramCallback( vlc_object_t *p_this, char const *psz_cmd,
                             void *p_data )
 {
     input_thread_t *p_input = (input_thread_t*)p_this;
-    (void)psz_cmd; (void)oldval; (void)p_data;
+    VLC_UNUSED(psz_cmd); VLC_UNUSED(oldval); VLC_UNUSED(p_data);
 
     input_ControlPush( p_input, INPUT_CONTROL_SET_PROGRAM, &newval );
 
@@ -598,7 +606,7 @@ static int TitleCallback( vlc_object_t *p_this, char const *psz_cmd,
 {
     input_thread_t *p_input = (input_thread_t*)p_this;
     vlc_value_t val, count;
-    (void)oldval; (void)p_data;
+    VLC_UNUSED(oldval); VLC_UNUSED(p_data);
 
     if( !strcmp( psz_cmd, "next-title" ) )
     {
@@ -631,7 +639,7 @@ static int SeekpointCallback( vlc_object_t *p_this, char const *psz_cmd,
 {
     input_thread_t *p_input = (input_thread_t*)p_this;
     vlc_value_t val, count;
-    (void)oldval; (void)p_data;
+    VLC_UNUSED(oldval); VLC_UNUSED(p_data);
 
     if( !strcmp( psz_cmd, "next-chapter" ) )
     {
@@ -664,7 +672,7 @@ static int NavigationCallback( vlc_object_t *p_this, char const *psz_cmd,
 {
     input_thread_t *p_input = (input_thread_t*)p_this;
     vlc_value_t     val;
-    (void)psz_cmd; (void)oldval;
+    VLC_UNUSED(psz_cmd); VLC_UNUSED(oldval);
 
     /* Issue a title change */
     val.i_int = (intptr_t)p_data;
@@ -684,7 +692,7 @@ static int ESCallback( vlc_object_t *p_this, char const *psz_cmd,
                        vlc_value_t oldval, vlc_value_t newval, void *p_data )
 {
     input_thread_t *p_input = (input_thread_t*)p_this;
-    (void)oldval; (void)p_data;
+    VLC_UNUSED(oldval); VLC_UNUSED(p_data);
 
     if( newval.i_int < 0 )
     {
@@ -713,7 +721,7 @@ static int EsDelayCallback ( vlc_object_t *p_this, char const *psz_cmd,
                              vlc_value_t oldval, vlc_value_t newval, void *p_data )
 {
     input_thread_t *p_input = (input_thread_t*)p_this;
-    (void)oldval; (void)p_data;
+    VLC_UNUSED(oldval); VLC_UNUSED(p_data);
 
     if( !strcmp( psz_cmd, "audio-delay" ) )
     {
@@ -734,7 +742,7 @@ static int BookmarkCallback( vlc_object_t *p_this, char const *psz_cmd,
                              void *p_data )
 {
     input_thread_t *p_input = (input_thread_t*)p_this;
-    (void)psz_cmd; (void)oldval; (void)p_data;
+    VLC_UNUSED(psz_cmd); VLC_UNUSED(oldval); VLC_UNUSED(p_data);
 
     input_ControlPush( p_input, INPUT_CONTROL_SET_BOOKMARK, &newval );