]> git.sesse.net Git - vlc/commitdiff
audio_output: Properly lock the input_fifos_lock in aout_Restart.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Mon, 11 Aug 2008 23:06:55 +0000 (01:06 +0200)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Mon, 11 Aug 2008 23:17:27 +0000 (01:17 +0200)
(Should fix a number of crash^W assert report that we had in apple-bugreport ml).

src/audio_output/intf.c

index ae41f05e9b714c895ad2a63121679db2a47b69cb..5bec5b9894a57f2dc2ec0cc94e7007fcd086c60f 100644 (file)
@@ -379,6 +379,8 @@ static int aout_Restart( aout_instance_t * p_aout )
     }
 
     /* Lock all inputs. */
+    vlc_mutex_lock( &p_aout->input_fifos_lock );
+
     for ( i = 0; i < p_aout->i_nb_inputs; i++ )
     {
         vlc_mutex_lock( &p_aout->pp_inputs[i]->lock );
@@ -397,6 +399,7 @@ static int aout_Restart( aout_instance_t * p_aout )
         {
             vlc_mutex_unlock( &p_aout->pp_inputs[i]->lock );
         }
+        vlc_mutex_unlock( &p_aout->input_fifos_lock );
         vlc_mutex_unlock( &p_aout->mixer_lock );
         return -1;
     }
@@ -408,6 +411,7 @@ static int aout_Restart( aout_instance_t * p_aout )
         {
             vlc_mutex_unlock( &p_aout->pp_inputs[i]->lock );
         }
+        vlc_mutex_unlock( &p_aout->input_fifos_lock );
         vlc_mutex_unlock( &p_aout->mixer_lock );
         return -1;
     }
@@ -422,6 +426,7 @@ static int aout_Restart( aout_instance_t * p_aout )
         vlc_mutex_unlock( &p_input->lock );
     }
 
+    vlc_mutex_unlock( &p_aout->input_fifos_lock );
     vlc_mutex_unlock( &p_aout->mixer_lock );
 
     return b_error;