]> git.sesse.net Git - vlc/blobdiff - src/stream_output/sap.c
libvlccore: push threads cancellation down vlc_thread_create
[vlc] / src / stream_output / sap.c
index b23e71dc79630606fca7a73812adb30a777826fe..0c4e3f9dc30bda7418b61d22ef343e7f0cca135d 100644 (file)
@@ -192,6 +192,11 @@ static void * RunThread( vlc_object_t *p_this)
 {
     sap_handler_t *p_sap = (sap_handler_t*)p_this;
     sap_session_t *p_session;
+    int canc = vlc_savecancel ();
+    /* TODO: Once net_Write() is cancel-safe, so will this whole thread.
+     * However, there is a more serious issues here: msleep(SAP_IDLE).
+     * This thread should really use poll().
+     */
 
     while( !p_sap->b_die )
     {
@@ -236,6 +241,7 @@ static void * RunThread( vlc_object_t *p_this)
         }
         vlc_object_unlock( p_sap );
     }
+    vlc_restorecancel (canc);
     return NULL;
 }