Changeset 6a440b7379fe87ed67f175893e2e7763d62e7ef6

Show
Ignore:
Timestamp:
11/21/07 23:28:20 (10 months ago)
Author:
Jean-Paul Saman <jpsaman@videolan.org>
git-committer:
Jean-Paul Saman <jpsaman@videolan.org> 1195684100 +0000
git-parent:

[ab76f23e74331f22d90075a4069b9e0922985759]

git-author:
Jean-Paul Saman <jpsaman@videolan.org> 1195684100 +0000
Message:

Patch by Glen Gray: RTSP keep alive fix. If the server doesn't handle RTCP-RR packets and requires specific GET_PARAMETER commands (such as Kasenna) then the session times out when vlc is paused because the current version only sends the info when Demux() is called. Demux() is only called when data is received. This patch fixes this issue with a boolean that is set during PAUSED state that allows the timer thread to send the GET_PARAMTER messages instead and thus keeping the RTSP session alive.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/demux/live555.cpp

    rd9f68c8 r6a440b7  
    147147 
    148148    int64_t      i_remain; 
     149    vlc_bool_t   b_handle_keep_alive; 
    149150    demux_sys_t  *p_sys; 
    150151}; 
     
    12501251                    return VLC_EGENERIC; 
    12511252            } 
     1253 
     1254            /* When we Pause, we'll need the TimeoutPrevention thread to 
     1255             * handle sending the "Keep Alive" message to the server.  
     1256             * Unfortunately Live555 isn't thread safe and so can't  
     1257             * do this normally while the main Demux thread is handling 
     1258             * a live stream. We end up with the Timeout thread blocking 
     1259             * waiting for a response from the server. So when we PAUSE 
     1260             * we set a flag that the TimeoutPrevention function will check 
     1261             * and if it's set, it will trigger the GET_PARAMETER message */ 
     1262            if( b_bool && p_sys->p_timeout != NULL ) 
     1263                p_sys->p_timeout->b_handle_keep_alive = VLC_TRUE; 
     1264            else if( !b_bool && p_sys->p_timeout != NULL )  
     1265                p_sys->p_timeout->b_handle_keep_alive = VLC_FALSE; 
     1266 
    12521267            es_out_Control( p_demux->out, ES_OUT_RESET_PCR ); 
    12531268            p_sys->i_pcr = 0; 
     
    16171632        if( p_timeout->i_remain <= 0 ) 
    16181633        { 
     1634            char *psz_bye = NULL; 
    16191635            p_timeout->i_remain = (int64_t)p_timeout->p_sys->i_timeout -2; 
    16201636            p_timeout->i_remain *= 1000000; 
    1621             p_timeout->p_sys->b_timeout_call = VLC_TRUE; 
    16221637            msg_Dbg( p_timeout, "reset the timeout timer" ); 
     1638            if( p_timeout->b_handle_keep_alive == VLC_TRUE ) 
     1639            { 
     1640#if LIVEMEDIA_LIBRARY_VERSION_INT >= 1138089600 
     1641                p_timeout->p_sys->rtsp->getMediaSessionParameter( *p_timeout->p_sys->ms, NULL, psz_bye ); 
     1642#endif 
     1643                p_timeout->p_sys->b_timeout_call = VLC_FALSE; 
     1644            } 
     1645            else 
     1646            { 
     1647                p_timeout->p_sys->b_timeout_call = VLC_TRUE; 
     1648            } 
    16231649        } 
    16241650        p_timeout->i_remain -= 200000;