No functionnality changes yet as the demuxers need to honor it.
I have add an extra bool to DEMUX_SET_POSITION/TIME to ask for precise
seeking to the demuxer.
(You cannot have precision and speed when seeking with non intra only codec).
/* I. Common queries to access_demux and demux */
/* POSITION double between 0.0 and 1.0 */
DEMUX_GET_POSITION, /* arg1= double * res= */
- DEMUX_SET_POSITION, /* arg1= double res=can fail */
+ DEMUX_SET_POSITION, /* arg1= double arg2= bool b_precise res=can fail */
/* LENGTH/TIME in microsecond, 0 if unknown */
DEMUX_GET_LENGTH, /* arg1= int64_t * res= */
DEMUX_GET_TIME, /* arg1= int64_t * res= */
- DEMUX_SET_TIME, /* arg1= int64_t res=can fail */
+ DEMUX_SET_TIME, /* arg1= int64_t arg2= bool b_precise res=can fail */
/* TITLE_INFO only if more than 1 title or 1 chapter */
DEMUX_GET_TITLE_INFO, /* arg1=input_title_t*** arg2=int*
msg_Warn( p_input, "invalid stop-time ignored" );
p_input->p->i_stop = 0;
}
+ p_input->p->b_fast_seek = var_GetBool( p_input, "input-fast-seek" );
}
static void LoadSubtitles( input_thread_t *p_input )
/* Reset the decoders states and clock sync (before calling the demuxer */
es_out_SetTime( p_input->p->p_es_out, -1 );
if( demux_Control( p_input->p->input.p_demux, DEMUX_SET_POSITION,
- f_pos ) )
+ f_pos, !p_input->p->b_fast_seek ) )
{
msg_Err( p_input, "INPUT_CONTROL_SET_POSITION(_OFFSET) "
"%2.1f%% failed", f_pos * 100 );
es_out_SetTime( p_input->p->p_es_out, -1 );
i_ret = demux_Control( p_input->p->input.p_demux,
- DEMUX_SET_TIME, i_time );
+ DEMUX_SET_TIME, i_time,
+ !p_input->p->b_fast_seek );
if( i_ret )
{
int64_t i_length;
{
double f_pos = (double)i_time / (double)i_length;
i_ret = demux_Control( p_input->p->input.p_demux,
- DEMUX_SET_POSITION, f_pos );
+ DEMUX_SET_POSITION, f_pos,
+ !p_input->p->b_fast_seek );
}
}
if( i_ret )
break;
}
if( demux_Control( slave->p_demux,
- DEMUX_SET_TIME, i_time ) )
+ DEMUX_SET_TIME, i_time, true ) )
{
msg_Err( p_input, "seek failed for new slave" );
InputSourceClean( slave );
{
input_source_t *in = p_input->p->slave[i];
- if( demux_Control( in->p_demux, DEMUX_SET_TIME, i_time ) )
+ if( demux_Control( in->p_demux, DEMUX_SET_TIME, i_time, true ) )
{
if( !in->b_eof )
msg_Err( p_input, "seek failed for slave %d -> EOF", i );
int64_t i_stop; /* :stop-time, 0 if none */
int64_t i_run; /* :run-time, 0 if none */
int64_t i_time; /* Current time */
+ bool b_fast_seek;/* :input-fast-seek */
/* Title infos FIXME multi-input (not easy) ? */
int i_title;
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, "input-fast-seek", VLC_VAR_BOOL|VLC_VAR_DOINHERIT );
var_Create( p_input, "input-slave",
VLC_VAR_STRING | VLC_VAR_DOINHERIT );
#define RUN_TIME_LONGTEXT N_( \
"The stream will run this duration (in seconds)." )
+#define INPUT_FAST_SEEK_TEXT N_("Fast seek")
+#define INPUT_FAST_SEEK_LONGTEXT N_( \
+ "Favor speed over precision while seeking" )
+
#define INPUT_LIST_TEXT N_("Input list")
#define INPUT_LIST_LONGTEXT N_( \
"You can give a comma-separated list " \
add_integer( "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 );
+ change_safe ()
+
add_string( "input-list", NULL, NULL,
INPUT_LIST_TEXT, INPUT_LIST_LONGTEXT, true );
add_string( "input-slave", NULL, NULL,