]> git.sesse.net Git - vlc/commitdiff
rtp sout: fix race condition in RTSP
authorPierre Ynard <linkfanel@yahoo.fr>
Wed, 27 Jan 2010 23:55:00 +0000 (00:55 +0100)
committerPierre Ynard <linkfanel@yahoo.fr>
Wed, 27 Jan 2010 23:55:00 +0000 (00:55 +0100)
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.

modules/stream_out/rtsp.c

index 6341f4d3d2fea6e47dae05b5ff2c372bbb47b27e..1f58f75e0edf74ed488fc81a8fbe1ff6264fa454 100644 (file)
@@ -244,6 +244,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++ )
     {
@@ -261,7 +263,6 @@ void RtspDelId( rtsp_stream_t *rtsp, rtsp_stream_id_t *id )
     }
 
     vlc_mutex_unlock( &rtsp->lock );
-    httpd_UrlDelete( id->url );
     free( id );
 }