Commit bae7c730 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

input/input.c: Define DEMUX_CAN_SEEK and correctly set "seekable" accordingly....

input/input.c: Define DEMUX_CAN_SEEK and correctly set "seekable" accordingly. (This could introduce regression such as seekable item no more seekable, but I should have greped enough...).
parent bb2e9c90
......@@ -140,6 +140,8 @@ enum demux_query_e
/* DEMUX_SET_RATE is called only if DEMUX_CAN_CONTROL_RATE has returned true.
* It should return the value really used in *pi_rate */
DEMUX_SET_RATE, /* arg1= int*pi_rate can fail */
DEMUX_CAN_SEEK, /* arg1= vlc_bool_t* can fail (assume false)*/
};
VLC_EXPORT( int, demux2_vaControlHelper, ( stream_t *, int64_t i_start, int64_t i_end, int i_bitrate, int i_align, int i_query, va_list args ) );
......
......@@ -802,6 +802,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
{
/* Special for access_demux */
case DEMUX_CAN_PAUSE:
case DEMUX_CAN_SEEK:
case DEMUX_SET_PAUSE_STATE:
case DEMUX_CAN_CONTROL_PACE:
pb = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
......
......@@ -1795,6 +1795,7 @@ static int DemuxControl( demux_t *p_demux, int i_query, va_list args )
{
/* Special for access_demux */
case DEMUX_CAN_PAUSE:
case DEMUX_CAN_SEEK:
case DEMUX_SET_PAUSE_STATE:
case DEMUX_CAN_CONTROL_PACE:
pb = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
......
......@@ -447,6 +447,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
/* Special for access_demux */
case DEMUX_CAN_PAUSE:
case DEMUX_CAN_SEEK:
case DEMUX_CAN_CONTROL_PACE:
/* TODO */
pb = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
......
......@@ -406,6 +406,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
/* Special for access_demux */
case DEMUX_CAN_PAUSE:
case DEMUX_CAN_SEEK:
case DEMUX_CAN_CONTROL_PACE:
/* TODO */
pb = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
......
......@@ -142,6 +142,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
{
/* Special for access_demux */
case DEMUX_CAN_PAUSE:
case DEMUX_CAN_SEEK:
case DEMUX_CAN_CONTROL_PACE:
pb = (vlc_bool_t *)va_arg( args, vlc_bool_t * );
*pb = VLC_TRUE;
......
......@@ -343,6 +343,11 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
{
/* Special for access_demux */
case DEMUX_CAN_PAUSE:
case DEMUX_CAN_SEEK:
pb = (vlc_bool_t *)va_arg( args, vlc_bool_t * );
*pb = VLC_TRUE;
return VLC_SUCCESS;
case DEMUX_SET_PAUSE_STATE:
return VLC_SUCCESS;
case DEMUX_CAN_CONTROL_PACE:
......
......@@ -176,6 +176,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
{
/* Special for access_demux */
case DEMUX_CAN_PAUSE:
case DEMUX_CAN_SEEK:
case DEMUX_CAN_CONTROL_PACE:
/* TODO */
pb = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
......
......@@ -581,6 +581,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
{
/* Special for access_demux */
case DEMUX_CAN_PAUSE:
case DEMUX_CAN_SEEK:
case DEMUX_SET_PAUSE_STATE:
case DEMUX_CAN_CONTROL_PACE:
pb = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
......
......@@ -991,6 +991,7 @@ static int DemuxControl( demux_t *p_demux, int i_query, va_list args )
{
/* Special for access_demux */
case DEMUX_CAN_PAUSE:
case DEMUX_CAN_SEEK:
case DEMUX_SET_PAUSE_STATE:
case DEMUX_CAN_CONTROL_PACE:
pb = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
......
......@@ -1256,6 +1256,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
}
/* Special for access_demux */
case DEMUX_CAN_PAUSE:
case DEMUX_CAN_SEEK:
pb = (vlc_bool_t*)va_arg( args, vlc_bool_t * );
if( p_sys->rtsp && p_sys->i_npt_length )
/* Not always true, but will be handled in SET_PAUSE_STATE */
......
......@@ -2266,10 +2266,11 @@ static int InputSourceInit( input_thread_t *p_input,
&in->b_can_pause ) )
in->b_can_pause = VLC_FALSE;
/* FIXME todo
demux2_Control( in->p_demux, DEMUX_CAN_SEEK,
int ret = demux2_Control( in->p_demux, DEMUX_CAN_SEEK,
&val.b_bool );
*/
if( ret != VLC_SUCCESS )
val.b_bool = VLC_FALSE;
var_Set( p_input, "seekable", val );
}
else
{
......
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