Commit 66db20b6 authored by Sam Hocevar's avatar Sam Hocevar

Allow :start-time, :stop-time and :run-time arguments to be float values,

since we may want sub-second granularity.
parent 3092afc3
......@@ -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" );
......
......@@ -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",
......
......@@ -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 )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment