Commit 7aca939a authored by Sebastien Escudier's avatar Sebastien Escudier Committed by Rémi Denis-Courmont

live555 timeout prevention thread fixes

Signed-off-by: default avatarRémi Denis-Courmont <rdenis@simphalempin.com>
parent e3db7651
...@@ -407,15 +407,15 @@ error: ...@@ -407,15 +407,15 @@ error:
if( p_sys->i_track ) free( p_sys->track ); if( p_sys->i_track ) free( p_sys->track );
if( p_sys->p_out_asf ) stream_DemuxDelete( p_sys->p_out_asf ); if( p_sys->p_out_asf ) stream_DemuxDelete( p_sys->p_out_asf );
if( p_sys->rtsp && p_sys->ms ) p_sys->rtsp->teardownMediaSession( *p_sys->ms ); if( p_sys->rtsp && p_sys->ms ) p_sys->rtsp->teardownMediaSession( *p_sys->ms );
if( p_sys->ms ) Medium::close( p_sys->ms );
if( p_sys->rtsp ) RTSPClient::close( p_sys->rtsp );
if( p_sys->env ) p_sys->env->reclaim();
if( p_sys->p_timeout ) if( p_sys->p_timeout )
{ {
vlc_cancel( p_sys->p_timeout->handle ); vlc_cancel( p_sys->p_timeout->handle );
vlc_join( p_sys->p_timeout->handle, NULL ); vlc_join( p_sys->p_timeout->handle, NULL );
free( p_sys->p_timeout ); free( p_sys->p_timeout );
} }
if( p_sys->ms ) Medium::close( p_sys->ms );
if( p_sys->rtsp ) RTSPClient::close( p_sys->rtsp );
if( p_sys->env ) p_sys->env->reclaim();
delete p_sys->scheduler; delete p_sys->scheduler;
free( p_sys->p_sdp ); free( p_sys->p_sdp );
free( p_sys->psz_path ); free( p_sys->psz_path );
...@@ -448,15 +448,15 @@ static void Close( vlc_object_t *p_this ) ...@@ -448,15 +448,15 @@ static void Close( vlc_object_t *p_this )
if( p_sys->i_track ) free( p_sys->track ); if( p_sys->i_track ) free( p_sys->track );
if( p_sys->p_out_asf ) stream_DemuxDelete( p_sys->p_out_asf ); if( p_sys->p_out_asf ) stream_DemuxDelete( p_sys->p_out_asf );
if( p_sys->rtsp && p_sys->ms ) p_sys->rtsp->teardownMediaSession( *p_sys->ms ); if( p_sys->rtsp && p_sys->ms ) p_sys->rtsp->teardownMediaSession( *p_sys->ms );
if( p_sys->ms ) Medium::close( p_sys->ms );
if( p_sys->rtsp ) RTSPClient::close( p_sys->rtsp );
if( p_sys->env ) p_sys->env->reclaim();
if( p_sys->p_timeout ) if( p_sys->p_timeout )
{ {
vlc_cancel( p_sys->p_timeout->handle ); vlc_cancel( p_sys->p_timeout->handle );
vlc_join( p_sys->p_timeout->handle, NULL ); vlc_join( p_sys->p_timeout->handle, NULL );
free( p_sys->p_timeout ); free( p_sys->p_timeout );
} }
if( p_sys->ms ) Medium::close( p_sys->ms );
if( p_sys->rtsp ) RTSPClient::close( p_sys->rtsp );
if( p_sys->env ) p_sys->env->reclaim();
delete p_sys->scheduler; delete p_sys->scheduler;
free( p_sys->p_sdp ); free( p_sys->p_sdp );
free( p_sys->psz_path ); free( p_sys->psz_path );
...@@ -1042,15 +1042,22 @@ static int Play( demux_t *p_demux ) ...@@ -1042,15 +1042,22 @@ static int Play( demux_t *p_demux )
{ {
msg_Dbg( p_demux, "We have a timeout of %d seconds", p_sys->i_timeout ); msg_Dbg( p_demux, "We have a timeout of %d seconds", p_sys->i_timeout );
p_sys->p_timeout = (timeout_thread_t *)malloc( sizeof(timeout_thread_t) ); p_sys->p_timeout = (timeout_thread_t *)malloc( sizeof(timeout_thread_t) );
p_sys->p_timeout->p_sys = p_demux->p_sys; /* lol, object recursion :D */ if( p_sys->p_timeout )
if( vlc_clone( &p_sys->p_timeout->handle, TimeoutPrevention,
p_sys->p_timeout, VLC_THREAD_PRIORITY_LOW ) )
{ {
msg_Err( p_demux, "cannot spawn liveMedia timeout thread" ); memset( p_sys->p_timeout, 0, sizeof(timeout_thread_t) );
free( p_sys->p_timeout ); p_sys->p_timeout->p_sys = p_demux->p_sys; /* lol, object recursion :D */
p_sys->p_timeout = NULL; if( vlc_clone( &p_sys->p_timeout->handle, TimeoutPrevention,
p_sys->p_timeout, VLC_THREAD_PRIORITY_LOW ) )
{
msg_Err( p_demux, "cannot spawn liveMedia timeout thread" );
free( p_sys->p_timeout );
p_sys->p_timeout = NULL;
}
else
msg_Dbg( p_demux, "spawned timeout thread" );
} }
msg_Dbg( p_demux, "spawned timeout thread" ); else
msg_Err( p_demux, "cannot spawn liveMedia timeout thread" );
} }
} }
p_sys->i_pcr = 0; p_sys->i_pcr = 0;
......
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