Commit 991aa6aa authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Allow demux to select the PTS delay, fallback to access

This will allow the SDP parsers to set their PTS delay according
to rtsp-caching/rtp-caching rather than the caching value of the
access module. The access module is irrelevant in that particular
case.
parent b2c851f4
......@@ -1019,6 +1019,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
case DEMUX_SET_GROUP:
case DEMUX_HAS_UNSUPPORTED_META:
case DEMUX_GET_ATTACHMENTS:
case DEMUX_GET_PTS_DELAY:
return VLC_EGENERIC;
default:
......
......@@ -636,6 +636,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
p_sys->i_next_demux_date = (int64_t)va_arg( args, int64_t );
return VLC_SUCCESS;
case DEMUX_GET_PTS_DELAY:
case DEMUX_GET_FPS:
case DEMUX_GET_META:
case DEMUX_GET_ATTACHMENTS:
......
......@@ -329,6 +329,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
p_sys->i_next_demux_date = (int64_t)va_arg( args, int64_t );
return VLC_SUCCESS;
case DEMUX_GET_PTS_DELAY:
case DEMUX_GET_FPS:
case DEMUX_GET_META:
case DEMUX_GET_TITLE_INFO:
......
......@@ -312,6 +312,7 @@ int demux_vaControlHelper( stream_t *s,
}
return VLC_EGENERIC;
case DEMUX_GET_PTS_DELAY:
case DEMUX_GET_FPS:
case DEMUX_GET_META:
case DEMUX_HAS_UNSUPPORTED_META:
......
......@@ -2388,12 +2388,6 @@ static int InputSourceInit( input_thread_t *p_input,
if( in->p_demux )
{
/* Get infos from access_demux */
int i_ret = demux_Control( in->p_demux,
DEMUX_GET_PTS_DELAY, &in->i_pts_delay );
assert( !i_ret );
in->i_pts_delay = __MAX( 0, __MIN( in->i_pts_delay, INPUT_PTS_DELAY_MAX ) );
in->b_title_demux = true;
if( demux_Control( in->p_demux, DEMUX_GET_TITLE_INFO,
&in->title, &in->i_title,
......@@ -2454,9 +2448,6 @@ static int InputSourceInit( input_thread_t *p_input,
if( !p_input->b_preparsing )
{
bool b_can_seek;
access_Control( in->p_access,
ACCESS_GET_PTS_DELAY, &in->i_pts_delay );
in->i_pts_delay = __MAX( 0, __MIN( in->i_pts_delay, INPUT_PTS_DELAY_MAX ) );
in->b_title_demux = false;
if( access_Control( in->p_access, ACCESS_GET_TITLE_INFO,
......@@ -2603,7 +2594,7 @@ static int InputSourceInit( input_thread_t *p_input,
/* get attachment
* FIXME improve for b_preparsing: move it after GET_META and check psz_arturl */
if( 1 || !p_input->b_preparsing )
if( !p_input->b_preparsing )
{
int i_attachment;
input_attachment_t **attachment;
......@@ -2615,7 +2606,24 @@ static int InputSourceInit( input_thread_t *p_input,
i_attachment, attachment );
vlc_mutex_unlock( &p_input->p->p_item->lock );
}
/* PTS delay: request from demux first. This is required for
* access_demux and some special cases like SDP demux. Otherwise,
* fallback to access */
if( demux_Control( in->p_demux, DEMUX_GET_PTS_DELAY,
&in->i_pts_delay ) )
{
/* GET_PTS_DELAY is mandatory for access_demux */
assert( in->p_access );
access_Control( in->p_access,
ACCESS_GET_PTS_DELAY, &in->i_pts_delay );
}
if( in->i_pts_delay > INPUT_PTS_DELAY_MAX )
in->i_pts_delay = INPUT_PTS_DELAY_MAX;
else if( in->i_pts_delay < 0 )
in->i_pts_delay = 0;
}
if( !demux_Control( in->p_demux, DEMUX_GET_FPS, &f_fps ) && f_fps > 0.0 )
{
vlc_mutex_lock( &p_input->p->p_item->lock );
......
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