[vlc-devel] commit: Fix a race condition between rtsp and httpd ( Sébastien Escudier )

git version control git at videolan.org
Mon Feb 9 17:23:01 CET 2009


vlc | branch: master | Sébastien Escudier <sebastien-devel at celeos.eu> | Thu Feb  5 14:08:22 2009 +0100| [c7eb703de55f9a0a0a03de0e025ad342bd1ab11a] | committer: Rémi Denis-Courmont 

Fix a race condition between rtsp and httpd

This can happen when a rtsp client teardown : RtspCallback is called.
But at the same time, if the media is deleted, (MediaDel), RtspClientDel can be called twice on the same p_media/p_rtsp

Signed-off-by: Rémi Denis-Courmont <rdenis at simphalempin.com>

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

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

diff --git a/modules/misc/rtsp.c b/modules/misc/rtsp.c
index 18213d4..0dd3e93 100644
--- a/modules/misc/rtsp.c
+++ b/modules/misc/rtsp.c
@@ -472,11 +472,12 @@ static void MediaDel( vod_t *p_vod, vod_media_t *p_media )
     TAB_REMOVE( p_sys->i_media, p_sys->media, p_media );
     vlc_mutex_unlock( &p_sys->lock_media );
 
+    httpd_UrlDelete( p_media->p_rtsp_url );
+
     while( p_media->i_rtsp > 0 )
         RtspClientDel( p_media, p_media->rtsp[0] );
     TAB_CLEAN( p_media->i_rtsp, p_media->rtsp );
 
-    httpd_UrlDelete( p_media->p_rtsp_url );
     free( p_media->psz_rtsp_path );
     free( p_media->psz_rtsp_control_v6 );
     free( p_media->psz_rtsp_control_v4 );




More information about the vlc-devel mailing list