Commit fe664dcd authored by Sébastien Escudier's avatar Sébastien Escudier Committed by Rémi Denis-Courmont

live555 : fix pause and seek behaviour.

We must not send PAUSE if already in pause, when seeking (it would
unpause the stream). And DEMUX_SET_PAUSE_STATE should do nothing if
pause state is already what we want.
Signed-off-by: default avatarRémi Denis-Courmont <remi@remlab.net>
parent 2eeddcf4
...@@ -1284,10 +1284,15 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) ...@@ -1284,10 +1284,15 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
time = f * (double)p_sys->i_npt_length; /* in second */ time = f * (double)p_sys->i_npt_length; /* in second */
} }
if( !p_sys->rtsp->pauseMediaSession( *p_sys->ms ) || if( !p_sys->b_paused && !p_sys->rtsp->pauseMediaSession( *p_sys->ms ))
!p_sys->rtsp->playMediaSession( *p_sys->ms, time, -1, 1 ) )
{ {
msg_Err( p_demux, "PLAY failed %s", msg_Err( p_demux, "PAUSE before seek failed failed %s",
p_sys->env->getResultMsg() );
return VLC_EGENERIC;
}
if( !p_sys->rtsp->playMediaSession( *p_sys->ms, time, -1, 1 ) )
{
msg_Err( p_demux, "seek PLAY failed %s",
p_sys->env->getResultMsg() ); p_sys->env->getResultMsg() );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -1402,19 +1407,20 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) ...@@ -1402,19 +1407,20 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
case DEMUX_SET_PAUSE_STATE: case DEMUX_SET_PAUSE_STATE:
{ {
int i; int i;
bool b_pause = (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 */ if( b_pause == p_sys->b_paused )
if( ( p_sys->b_paused && !p_sys->rtsp->pauseMediaSession( *p_sys->ms ) ) || return VLC_SUCCESS;
( !p_sys->b_paused && !p_sys->rtsp->playMediaSession( *p_sys->ms, if( ( b_pause && !p_sys->rtsp->pauseMediaSession( *p_sys->ms ) ) ||
( !b_pause && !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() );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
p_sys->b_paused = b_pause;
/* When we Pause, we'll need the TimeoutPrevention thread to /* When we Pause, we'll need the TimeoutPrevention thread to
* handle sending the "Keep Alive" message to the server. * handle sending the "Keep Alive" message to the server.
......
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