vlc_linux/vlc-3.0.16/modules/access/live555.cpp
/*****************************************************************************
 * Play: starts the actual playback of the stream
 *****************************************************************************/
starts the actual playback of the stream
starts the actual playback of the stream
static int Play( demux_t *p_demux )
{
    demux_sys_t *p_sys = p_demux->p_sys;
    if( p_sys->rtsp )
    {
        p_sys->rtsp->sendPlayCommand( *p_sys->ms, default_live555_callback, p_sys->f_npt_start, -1, 1 );
        if( !wait_Live555_response(p_demux) )
        {
            msg_Err( p_demux, "RTSP PLAY failed %s", p_sys->env->getResultMsg() );
            return VLC_EGENERIC;
        }
        int timeout = p_sys->rtsp->sessionTimeoutParameter();
        if( timeout <= 2 )
            timeout = 60; 
        msg_Dbg( p_demux, "We have a timeout of %d seconds", timeout );
        mtime_t interval = (timeout - 2) * CLOCK_FREQ;
        vlc_timer_schedule( p_sys->timer, false, interval, interval);
    }
    p_sys->i_pcr = VLC_TS_INVALID;
    p_sys->f_npt_start = p_sys->ms->playStartTime();
    if( p_sys->ms->playEndTime() > 0 )
        p_sys->f_npt_length = p_sys->ms->playEndTime();
    msg_Dbg( p_demux, "play start: %f stop:%f", p_sys->f_npt_start, p_sys->f_npt_length );
    return VLC_SUCCESS;
}
static int Play ( demux_t * p_demux ) { demux_sys_t * p_sys = p_demux -> p_sys ; if ( p_sys -> rtsp ) { p_sys -> rtsp -> sendPlayCommand ( * p_sys -> ms , default_live555_callback , p_sys -> f_npt_start , -1 , 1 ) ; if ( ! wait_Live555_response ( p_demux ) ) { msg_Err ( p_demux , " " , p_sys -> env -> getResultMsg ( ) ) ; return VLC_EGENERIC ; } int timeout = p_sys -> rtsp -> sessionTimeoutParameter ( ) ; if ( timeout <= 2 ) timeout = 60 ; msg_Dbg ( p_demux , " " , timeout ) ; mtime_t interval = ( timeout - 2 ) * CLOCK_FREQ ; vlc_timer_schedule ( p_sys -> timer , false , interval , interval ) ; } p_sys -> i_pcr = VLC_TS_INVALID ; p_sys -> f_npt_start = p_sys -> ms -> playStartTime ( ) ; if ( p_sys -> ms -> playEndTime ( ) > 0 ) p_sys -> f_npt_length = p_sys -> ms -> playEndTime ( ) ; msg_Dbg ( p_demux , " " , p_sys -> f_npt_start , p_sys -> f_npt_length ) ; return VLC_SUCCESS ; }
Play: starts the actual playback of the stream
Play : starts the actual playback of the stream
/* The PLAY */ /* Retrieve the timeout value and set up a timeout prevention thread */ /* default value from RFC2326 */ /* Retrieve the starttime if possible */