]> git.sesse.net Git - vlc/blobdiff - modules/stream_out/rtp.c
Plugins: push cancellation down
[vlc] / modules / stream_out / rtp.c
index fb79a6881801efd34feb9e7338aa63b2e4cc85f1..3d11cea6864eb2f9e3b80c6c3af0c9f1945448ab 100644 (file)
@@ -232,7 +232,7 @@ static int               MuxSend( sout_stream_t *, sout_stream_id_t *,
                                   block_t* );
 
 static sout_access_out_t *GrabberCreate( sout_stream_t *p_sout );
-static void ThreadSend( vlc_object_t *p_this );
+static void* ThreadSend( vlc_object_t *p_this );
 
 static void SDPHandleUrl( sout_stream_t *, const char * );
 
@@ -1014,6 +1014,7 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
         {
             id->psz_enc = "MP2P";
         }
+        free( psz );
     }
     else
     switch( p_fmt->i_codec )
@@ -1429,10 +1430,11 @@ static int  HttpCallback( httpd_file_sys_t *p_args,
 /****************************************************************************
  * RTP send
  ****************************************************************************/
-static void ThreadSend( vlc_object_t *p_this )
+static void* ThreadSend( vlc_object_t *p_this )
 {
     sout_stream_id_t *id = (sout_stream_id_t *)p_this;
     unsigned i_caching = id->i_caching;
+    int canc = vlc_savecancel ();
 
     while( vlc_object_alive (id) )
     {
@@ -1498,6 +1500,8 @@ static void ThreadSend( vlc_object_t *p_this )
             rtp_add_sink( id, fd, true );
         }
     }
+    vlc_restorecancel (canc);
+    return NULL;
 }
 
 int rtp_add_sink( sout_stream_id_t *id, int fd, bool rtcp_mux )