[vlc-devel] commit: Better lock during I/O than crash ( Rémi Denis-Courmont )

git version control git at videolan.org
Sat Aug 16 18:21:34 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Sat Aug 16 19:23:43 2008 +0300| [97e5286b45b68345a40f7e5f39e0a80e7ba7ad07] | committer: Rémi Denis-Courmont 

Better lock during I/O than crash

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

 src/stream_output/sap.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/stream_output/sap.c b/src/stream_output/sap.c
index fc84ed7..b23e71d 100644
--- a/src/stream_output/sap.c
+++ b/src/stream_output/sap.c
@@ -197,6 +197,8 @@ static void * RunThread( vlc_object_t *p_this)
     {
         int i;
 
+        msleep( SAP_IDLE );
+
         /* If needed, get the rate info */
         if( p_sap->b_control == true )
         {
@@ -222,11 +224,9 @@ static void * RunThread( vlc_object_t *p_this)
         else
         {
             vlc_object_unlock( p_sap );
-            msleep( SAP_IDLE );
             continue;
         }
         p_session = p_sap->pp_sessions[p_sap->i_current_session];
-        vlc_object_unlock( p_sap );
 
         /* And announce it */
         if( p_session->p_address->b_enabled == true &&
@@ -234,8 +234,7 @@ static void * RunThread( vlc_object_t *p_this)
         {
             announce_SendSAPAnnounce( p_sap, p_session );
         }
-
-        msleep( SAP_IDLE );
+        vlc_object_unlock( p_sap );
     }
     return NULL;
 }




More information about the vlc-devel mailing list