[vlc-devel] commit: Allow :start-time, :stop-time and : run-time arguments to be float values, (Sam Hocevar )
git version control
git at videolan.org
Fri May 1 00:49:48 CEST 2009
vlc | branch: master | Sam Hocevar <sam at zoy.org> | Fri May 1 00:08:01 2009 +0200| [66db20b690c686d41198852c9cd54621ea769380] | committer: Sam Hocevar
Allow :start-time, :stop-time and :run-time arguments to be float values,
since we may want sub-second granularity.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=66db20b690c686d41198852c9cd54621ea769380
---
src/input/input.c | 9 ++++++---
src/input/var.c | 6 +++---
src/libvlc-module.c | 12 ++++++------
3 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/src/input/input.c b/src/input/input.c
index c7afcfe..3f51cf5 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -918,9 +918,12 @@ static void StartTitle( input_thread_t * p_input )
input_ControlPush( p_input, INPUT_CONTROL_SET_SEEKPOINT, &val );
/* Start/stop/run time */
- p_input->p->i_start = INT64_C(1000000) * var_GetInteger( p_input, "start-time" );
- p_input->p->i_stop = INT64_C(1000000) * var_GetInteger( p_input, "stop-time" );
- p_input->p->i_run = INT64_C(1000000) * var_GetInteger( p_input, "run-time" );
+ p_input->p->i_start = (int64_t)(1000000.0
+ * var_GetFloat( p_input, "start-time" ));
+ p_input->p->i_stop = (int64_t)(1000000.0
+ * var_GetFloat( p_input, "stop-time" ));
+ p_input->p->i_run = (int64_t)(1000000.0
+ * var_GetFloat( p_input, "run-time" ));
if( p_input->p->i_run < 0 )
{
msg_Warn( p_input, "invalid run-time ignored" );
diff --git a/src/input/var.c b/src/input/var.c
index 58547f1..f13d700 100644
--- a/src/input/var.c
+++ b/src/input/var.c
@@ -443,9 +443,9 @@ void input_ConfigVarInit ( input_thread_t *p_input )
var_Create( p_input, "input-repeat",
VLC_VAR_INTEGER|VLC_VAR_DOINHERIT );
- var_Create( p_input, "start-time", VLC_VAR_INTEGER|VLC_VAR_DOINHERIT );
- var_Create( p_input, "stop-time", VLC_VAR_INTEGER|VLC_VAR_DOINHERIT );
- var_Create( p_input, "run-time", VLC_VAR_INTEGER|VLC_VAR_DOINHERIT );
+ var_Create( p_input, "start-time", VLC_VAR_FLOAT|VLC_VAR_DOINHERIT );
+ var_Create( p_input, "stop-time", VLC_VAR_FLOAT|VLC_VAR_DOINHERIT );
+ var_Create( p_input, "run-time", VLC_VAR_FLOAT|VLC_VAR_DOINHERIT );
var_Create( p_input, "input-fast-seek", VLC_VAR_BOOL|VLC_VAR_DOINHERIT );
var_Create( p_input, "input-slave",
diff --git a/src/libvlc-module.c b/src/libvlc-module.c
index 3edcd9e..32bc5fe 100644
--- a/src/libvlc-module.c
+++ b/src/libvlc-module.c
@@ -1729,14 +1729,14 @@ vlc_module_begin ()
add_integer( "input-repeat", 0, NULL,
INPUT_REPEAT_TEXT, INPUT_REPEAT_LONGTEXT, false )
change_safe ()
- add_integer( "start-time", 0, NULL,
- START_TIME_TEXT, START_TIME_LONGTEXT, true )
+ add_float( "start-time", 0, NULL,
+ START_TIME_TEXT, START_TIME_LONGTEXT, true )
change_safe ()
- add_integer( "stop-time", 0, NULL,
- STOP_TIME_TEXT, STOP_TIME_LONGTEXT, true )
+ add_float( "stop-time", 0, NULL,
+ STOP_TIME_TEXT, STOP_TIME_LONGTEXT, true )
change_safe ()
- add_integer( "run-time", 0, NULL,
- RUN_TIME_TEXT, RUN_TIME_LONGTEXT, true )
+ add_float( "run-time", 0, NULL,
+ RUN_TIME_TEXT, RUN_TIME_LONGTEXT, true )
change_safe ()
add_bool( "input-fast-seek", false, NULL,
INPUT_FAST_SEEK_TEXT, INPUT_FAST_SEEK_LONGTEXT, false )
More information about the vlc-devel
mailing list