Commit 6b6096b2 authored by Jean-Paul Saman's avatar Jean-Paul Saman

live555: do not trigger "no data received in 10s" case when pausing during buffering

parent ad5c6b6f
...@@ -221,6 +221,7 @@ struct demux_sys_t ...@@ -221,6 +221,7 @@ struct demux_sys_t
char event; char event;
bool b_get_param; /* Does the server support GET_PARAMETER */ bool b_get_param; /* Does the server support GET_PARAMETER */
bool b_paused; /* Are we paused? */
}; };
static int Demux ( demux_t * ); static int Demux ( demux_t * );
...@@ -299,6 +300,7 @@ static int Open ( vlc_object_t *p_this ) ...@@ -299,6 +300,7 @@ static int Open ( vlc_object_t *p_this )
p_sys->psz_path = strdup( p_demux->psz_path ); p_sys->psz_path = strdup( p_demux->psz_path );
p_sys->b_force_mcast = var_CreateGetBool( p_demux, "rtsp-mcast" ); p_sys->b_force_mcast = var_CreateGetBool( p_demux, "rtsp-mcast" );
p_sys->b_get_param = false; p_sys->b_get_param = false;
p_sys->b_paused = false;
/* parse URL for rtsp://[user:[passwd]@]serverip:port/options */ /* parse URL for rtsp://[user:[passwd]@]serverip:port/options */
vlc_UrlParse( &p_sys->url, p_sys->psz_path, 0 ); vlc_UrlParse( &p_sys->url, p_sys->psz_path, 0 );
...@@ -1191,8 +1193,8 @@ static int Demux( demux_t *p_demux ) ...@@ -1191,8 +1193,8 @@ static int Demux( demux_t *p_demux )
return 0; return 0;
*/ */
} }
else if( !p_sys->b_multicast && p_sys->b_no_data && else if( !p_sys->b_multicast && !p_sys->b_paused &&
( p_sys->i_no_data_ti > 34 ) ) p_sys->b_no_data && ( p_sys->i_no_data_ti > 34 ) )
{ {
bool b_rtsp_tcp = var_GetBool( p_demux, "rtsp-tcp" ) || bool b_rtsp_tcp = var_GetBool( p_demux, "rtsp-tcp" ) ||
var_GetBool( p_demux, "rtsp-http" ); var_GetBool( p_demux, "rtsp-http" );
...@@ -1210,7 +1212,8 @@ static int Demux( demux_t *p_demux ) ...@@ -1210,7 +1212,8 @@ static int Demux( demux_t *p_demux )
msg_Err( p_demux, "no data received in 10s, aborting" ); msg_Err( p_demux, "no data received in 10s, aborting" );
return 0; return 0;
} }
else if( !p_sys->b_multicast && p_sys->i_no_data_ti > 34 ) else if( !p_sys->b_multicast && !p_sys->b_paused &&
( p_sys->i_no_data_ti > 34 ) )
{ {
/* EOF ? */ /* EOF ? */
msg_Warn( p_demux, "no data received in 10s, eof ?" ); msg_Warn( p_demux, "no data received in 10s, eof ?" );
...@@ -1398,13 +1401,13 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) ...@@ -1398,13 +1401,13 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
{ {
int i; int i;
b_bool = (bool)va_arg( args, int ); p_sys->b_paused = (bool)va_arg( args, int );
if( p_sys->rtsp == NULL ) if( p_sys->rtsp == NULL )
return VLC_EGENERIC; return VLC_EGENERIC;
/* FIXME */ /* FIXME */
if( ( b_bool && !p_sys->rtsp->pauseMediaSession( *p_sys->ms ) ) || if( ( p_sys->b_paused && !p_sys->rtsp->pauseMediaSession( *p_sys->ms ) ) ||
( !b_bool && !p_sys->rtsp->playMediaSession( *p_sys->ms, ( !p_sys->b_paused && !p_sys->rtsp->playMediaSession( *p_sys->ms,
-1 ) ) ) -1 ) ) )
{ {
msg_Err( p_demux, "PLAY or PAUSE failed %s", p_sys->env->getResultMsg() ); msg_Err( p_demux, "PLAY or PAUSE failed %s", p_sys->env->getResultMsg() );
...@@ -1419,9 +1422,9 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) ...@@ -1419,9 +1422,9 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
* waiting for a response from the server. So when we PAUSE * waiting for a response from the server. So when we PAUSE
* we set a flag that the TimeoutPrevention function will check * we set a flag that the TimeoutPrevention function will check
* and if it's set, it will trigger the GET_PARAMETER message */ * and if it's set, it will trigger the GET_PARAMETER message */
if( b_bool && p_sys->p_timeout != NULL ) if( p_sys->b_paused && p_sys->p_timeout != NULL )
p_sys->p_timeout->b_handle_keep_alive = true; p_sys->p_timeout->b_handle_keep_alive = true;
else if( !b_bool && p_sys->p_timeout != NULL ) else if( !p_sys->b_paused && p_sys->p_timeout != NULL )
p_sys->p_timeout->b_handle_keep_alive = false; p_sys->p_timeout->b_handle_keep_alive = false;
for( i = 0; !b_bool && i < p_sys->i_track; i++ ) for( i = 0; !b_bool && i < p_sys->i_track; i++ )
...@@ -1433,6 +1436,9 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) ...@@ -1433,6 +1436,9 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
es_out_Control( p_demux->out, ES_OUT_RESET_PCR ); es_out_Control( p_demux->out, ES_OUT_RESET_PCR );
} }
/* Reset data received counter */
p_sys->i_no_data_ti = 0;
/* Retrieve the starttime if possible */ /* Retrieve the starttime if possible */
p_sys->i_npt_start = p_sys->ms->playStartTime(); p_sys->i_npt_start = p_sys->ms->playStartTime();
......
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