Commit c7eb703d authored by Sébastien Escudier's avatar Sébastien Escudier Committed by 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: default avatarRémi Denis-Courmont <rdenis@simphalempin.com>
parent 03029fe3
...@@ -472,11 +472,12 @@ static void MediaDel( vod_t *p_vod, vod_media_t *p_media ) ...@@ -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 ); TAB_REMOVE( p_sys->i_media, p_sys->media, p_media );
vlc_mutex_unlock( &p_sys->lock_media ); vlc_mutex_unlock( &p_sys->lock_media );
httpd_UrlDelete( p_media->p_rtsp_url );
while( p_media->i_rtsp > 0 ) while( p_media->i_rtsp > 0 )
RtspClientDel( p_media, p_media->rtsp[0] ); RtspClientDel( p_media, p_media->rtsp[0] );
TAB_CLEAN( p_media->i_rtsp, p_media->rtsp ); 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_path );
free( p_media->psz_rtsp_control_v6 ); free( p_media->psz_rtsp_control_v6 );
free( p_media->psz_rtsp_control_v4 ); free( p_media->psz_rtsp_control_v4 );
......
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