]> git.sesse.net Git - vlc/blobdiff - modules/stream_out/rtsp.c
Splitted out spu_t and related functions to its own header.
[vlc] / modules / stream_out / rtsp.c
index 1f58f75e0edf74ed488fc81a8fbe1ff6264fa454..e237c0386494ecbda87f3ca6acca9a99b2f34a24 100644 (file)
@@ -122,12 +122,12 @@ error:
 
 void RtspUnsetup( rtsp_stream_t *rtsp )
 {
-    while( rtsp->sessionc > 0 )
-        RtspClientDel( rtsp, rtsp->sessionv[0] );
-
     if( rtsp->url )
         httpd_UrlDelete( rtsp->url );
 
+    while( rtsp->sessionc > 0 )
+        RtspClientDel( rtsp, rtsp->sessionv[0] );
+
     if( rtsp->host )
         httpd_HostDelete( rtsp->host );
 
@@ -538,8 +538,8 @@ static int RtspHandler( rtsp_stream_t *rtsp, rtsp_stream_id_t *id,
                     if( psz_session == NULL )
                     {
                         /* Create a dummy session ID */
-                        snprintf( psz_sesbuf, sizeof( psz_sesbuf ), "%d",
-                                  rand() );
+                        snprintf( psz_sesbuf, sizeof( psz_sesbuf ), "%lu",
+                                  vlc_mrand48() );
                         psz_session = psz_sesbuf;
                     }
                     answer->i_status = 200;