From: RĂ©mi Denis-Courmont Date: Sat, 16 Aug 2008 16:23:43 +0000 (+0300) Subject: Better lock during I/O than crash X-Git-Tag: 0.9.0~270 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=97e5286b45b68345a40f7e5f39e0a80e7ba7ad07;p=vlc Better lock during I/O than crash --- diff --git a/src/stream_output/sap.c b/src/stream_output/sap.c index fc84ed7961..b23e71dc79 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; }