Commit 987fc6e9 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

input: use DEMUX_CAN_SEEK instead of STREAM_CAN_SEEK

Some demuxers support seeking even if the underlying byte stream is not
seekable (e.g. subtitles). Also some demuxers do not support seeking
regardless of the underlying byte stream.

So it makes more sense to check the status from the demuxer. Most
demuxers just copy or forward the value from the byte stream.

Note: if in doubt, a demuxer can always claim seek support, and
eventually fail both DEMUX_SET_TIME and DEMUX_SET_POSITION. The seek is
only used as a hint for user interfaces; it has no effects on the input
thread as such.
parent f208b651
......@@ -2217,11 +2217,6 @@ static int InputSourceInit( input_thread_t *p_input,
var_SetBool( p_input, "can-pause", in->b_can_pause || !in->b_can_pace_control ); /* XXX temporary because of es_out_timeshift*/
var_SetBool( p_input, "can-rate", !in->b_can_pace_control || in->b_can_rate_control ); /* XXX temporary because of es_out_timeshift*/
var_SetBool( p_input, "can-rewind", !in->b_rescale_ts && !in->b_can_pace_control && in->b_can_rate_control );
bool b_can_seek;
if( demux_Control( in->p_demux, DEMUX_CAN_SEEK, &b_can_seek ) )
b_can_seek = false;
var_SetBool( p_input, "can-seek", b_can_seek );
}
else
{ /* Now try a real access */
......@@ -2312,8 +2307,6 @@ static int InputSourceInit( input_thread_t *p_input,
if( !p_input->b_preparsing )
{
bool b;
stream_Control( p_stream, STREAM_CAN_CONTROL_PACE,
&in->b_can_pace_control );
in->b_can_rate_control = in->b_can_pace_control;
......@@ -2327,9 +2320,6 @@ static int InputSourceInit( input_thread_t *p_input,
var_SetBool( p_input, "can-rewind",
!in->b_rescale_ts && !in->b_can_pace_control );
stream_Control( p_stream, STREAM_CAN_SEEK, &b );
var_SetBool( p_input, "can-seek", b );
in->b_title_demux = false;
stream_Control( p_stream, STREAM_GET_PTS_DELAY, &i_pts_delay );
......@@ -2379,6 +2369,11 @@ static int InputSourceInit( input_thread_t *p_input,
free( psz_var_demux );
free( psz_dup );
bool b_can_seek;
if( demux_Control( in->p_demux, DEMUX_CAN_SEEK, &b_can_seek ) )
b_can_seek = false;
var_SetBool( p_input, "can-seek", b_can_seek );
/* Set record capabilities */
if( demux_Control( in->p_demux, DEMUX_CAN_RECORD, &in->b_can_stream_record ) )
in->b_can_stream_record = 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