]> git.sesse.net Git - vlc/commitdiff
aout: lock output fifo later
authorJakob Leben <jleben@videolan.org>
Thu, 26 Nov 2009 10:58:46 +0000 (11:58 +0100)
committerJakob Leben <jleben@videolan.org>
Thu, 26 Nov 2009 10:58:46 +0000 (11:58 +0100)
src/audio_output/output.c

index e8c9b6bc0f24e5f98535f64666dedd6fabc8fd51..6cce79048674d8a3f7c96f9f56e972256e85be19 100644 (file)
@@ -53,14 +53,11 @@ int aout_OutputNew( aout_instance_t * p_aout,
         p_aout->output.output.i_rate = i_rate;
     aout_FormatPrepare( &p_aout->output.output );
 
-    aout_lock_output_fifo( p_aout );
-
     /* Find the best output plug-in. */
     p_aout->output.p_module = module_need( p_aout, "audio output", "$aout", false );
     if ( p_aout->output.p_module == NULL )
     {
         msg_Err( p_aout, "no suitable audio output module" );
-        aout_unlock_output_fifo( p_aout );
         return -1;
     }
 
@@ -163,6 +160,8 @@ int aout_OutputNew( aout_instance_t * p_aout,
 
     aout_FormatPrepare( &p_aout->output.output );
 
+    aout_lock_output_fifo( p_aout );
+
     /* Prepare FIFO. */
     aout_FifoInit( p_aout, &p_aout->output.fifo,
                    p_aout->output.output.i_rate );