]> git.sesse.net Git - vlc/commitdiff
* src/stream_output/stream_output.c: Use strtol for option parsing instead
authorChristophe Massiot <massiot@videolan.org>
Tue, 11 May 2004 14:03:50 +0000 (14:03 +0000)
committerChristophe Massiot <massiot@videolan.org>
Tue, 11 May 2004 14:03:50 +0000 (14:03 +0000)
  of atoi, because atoi assumes base 10.
* modules/access/dvb/access.c: New --dvb-caching option.
* modules/mux/mpeg/ts.c: Cosmetics.

modules/access/dvb/access.c
modules/mux/mpeg/ts.c
src/stream_output/stream_output.c

index 21e1b0d4044c6a95e663a2af0a4aaa44aeb5e286..acf11e4f10e2584e21850d95684a52b79d5935b1 100644 (file)
@@ -71,6 +71,11 @@ static void    CloseProgram( input_thread_t * p_input );
 /*****************************************************************************
  * Module descriptor
  *****************************************************************************/
+#define CACHING_TEXT N_("Caching value in ms")
+#define CACHING_LONGTEXT N_( \
+    "Allows you to modify the default caching value for dvb streams. This " \
+    "value should be set in millisecond units." )
+
 #define PROGRAM_TEXT N_("Program to decode")
 #define PROGRAM_LONGTEXT N_("This is a workaround for a bug in the input")
 
@@ -143,6 +148,8 @@ static void    CloseProgram( input_thread_t * p_input );
 vlc_module_begin();
     set_description( N_("DVB input with v4l2 support") );
 
+    add_integer( "dvb-caching", DEFAULT_PTS_DELAY / 1000, NULL, CACHING_TEXT,
+                 CACHING_LONGTEXT, VLC_TRUE );
     add_integer( "dvb-adapter", 0, NULL, ADAPTER_TEXT, ADAPTER_LONGTEXT,
                  VLC_FALSE );
     add_integer( "dvb-device", 0, NULL, DEVICE_TEXT, DEVICE_LONGTEXT,
@@ -251,6 +258,10 @@ static int Open( vlc_object_t *p_this )
         return( -1 );
     }
 
+    var_Create( p_input, "dvb-caching", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
+    var_Get( p_input, "dvb-caching", &val );
+    p_input->i_pts_delay = val.i_int * 1000;
+
     var_Create( p_input, "dvb-adapter", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
     var_Create( p_input, "dvb-device", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
     var_Create( p_input, "dvb-frequency", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
index da16153d3d01da31364cdf75093c9ab9ddcd46e2..60f6a1e40bf3810bcfb21616d2a0dfc7eb6dfcd6 100644 (file)
@@ -412,7 +412,7 @@ static int Open( vlc_object_t *p_this )
     if( p_sys->i_shaping_delay <= 0 )
     {
         msg_Err( p_mux,
-                 "invalid shaping ("I64Fd"ms) reseting to 200ms",
+                 "invalid shaping ("I64Fd"ms) resetting to 200ms",
                  p_sys->i_shaping_delay / 1000 );
         p_sys->i_shaping_delay = 200000;
     }
@@ -423,7 +423,7 @@ static int Open( vlc_object_t *p_this )
         p_sys->i_pcr_delay >= p_sys->i_shaping_delay )
     {
         msg_Err( p_mux,
-                 "invalid pcr delay ("I64Fd"ms) reseting to 30ms",
+                 "invalid pcr delay ("I64Fd"ms) resetting to 30ms",
                  p_sys->i_pcr_delay / 1000 );
         p_sys->i_pcr_delay = 30000;
     }
index 21035915ab3553ea11a5d8d10d16ec84642c577d..85bdd3964d765c1bacd13141d7c6344836527f64 100644 (file)
@@ -970,7 +970,8 @@ void __sout_ParseCfg( vlc_object_t *p_this, char *psz_prefix,
                 val.b_bool = b_yes;
                 break;
             case VLC_VAR_INTEGER:
-                val.i_int = atoi( cfg->psz_value ? cfg->psz_value : "0" );
+                val.i_int = strtol( cfg->psz_value ? cfg->psz_value : "0",
+                                    NULL, 0 );
                 break;
             case VLC_VAR_FLOAT:
                 val.f_float = atof( cfg->psz_value ? cfg->psz_value : "0" );