[vlc-devel] commit: rtp sout: fix race condition in RTSP (Pierre Ynard )

git version control git at videolan.org
Thu Jan 28 02:13:46 CET 2010


vlc/vlc-1.0 | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Thu Jan 28 00:55:00 2010 +0100| [2958da23068e1fd766279d848a5493408c577538] | committer: Pierre Ynard 

rtp sout: fix race condition in RTSP

When an ES is removed, it is possible to set up a track that won't be
cleaned up and will remain dangling, causing a crash later. Make sure
we unregister the RTSP URL before cleaning up.
(cherry picked from commit 1dc6a868e2fc711565160e0fa5889d1ebda9cf27)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.0.git/?a=commit;h=2958da23068e1fd766279d848a5493408c577538
---

 modules/stream_out/rtsp.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/modules/stream_out/rtsp.c b/modules/stream_out/rtsp.c
index d338ab7..85b5d78 100644
--- a/modules/stream_out/rtsp.c
+++ b/modules/stream_out/rtsp.c
@@ -228,6 +228,8 @@ rtsp_stream_id_t *RtspAddId( rtsp_stream_t *rtsp, sout_stream_id_t *sid,
 
 void RtspDelId( rtsp_stream_t *rtsp, rtsp_stream_id_t *id )
 {
+    httpd_UrlDelete( id->url );
+
     vlc_mutex_lock( &rtsp->lock );
     for( int i = 0; i < rtsp->sessionc; i++ )
     {
@@ -245,7 +247,6 @@ void RtspDelId( rtsp_stream_t *rtsp, rtsp_stream_id_t *id )
     }
 
     vlc_mutex_unlock( &rtsp->lock );
-    httpd_UrlDelete( id->url );
     free( id );
 }
 




More information about the vlc-devel mailing list