Commit 97e5286b authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Better lock during I/O than crash

parent 867a8159
...@@ -197,6 +197,8 @@ static void * RunThread( vlc_object_t *p_this) ...@@ -197,6 +197,8 @@ static void * RunThread( vlc_object_t *p_this)
{ {
int i; int i;
msleep( SAP_IDLE );
/* If needed, get the rate info */ /* If needed, get the rate info */
if( p_sap->b_control == true ) if( p_sap->b_control == true )
{ {
...@@ -222,11 +224,9 @@ static void * RunThread( vlc_object_t *p_this) ...@@ -222,11 +224,9 @@ static void * RunThread( vlc_object_t *p_this)
else else
{ {
vlc_object_unlock( p_sap ); vlc_object_unlock( p_sap );
msleep( SAP_IDLE );
continue; continue;
} }
p_session = p_sap->pp_sessions[p_sap->i_current_session]; p_session = p_sap->pp_sessions[p_sap->i_current_session];
vlc_object_unlock( p_sap );
/* And announce it */ /* And announce it */
if( p_session->p_address->b_enabled == true && if( p_session->p_address->b_enabled == true &&
...@@ -234,8 +234,7 @@ static void * RunThread( vlc_object_t *p_this) ...@@ -234,8 +234,7 @@ static void * RunThread( vlc_object_t *p_this)
{ {
announce_SendSAPAnnounce( p_sap, p_session ); announce_SendSAPAnnounce( p_sap, p_session );
} }
vlc_object_unlock( p_sap );
msleep( SAP_IDLE );
} }
return NULL; return NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment