[vlc-devel] commit: Fix another potential audio output dead lock ( Rémi Denis-Courmont )

git version control git at videolan.org
Sun Nov 29 17:35:23 CET 2009


vlc | branch: 1.0-bugfix | Rémi Denis-Courmont <remi at remlab.net> | Sun Nov 29 18:10:33 2009 +0200| [fae61d7b665e0af6bde2c9d07dac3de90bf9dde1] | committer: Rémi Denis-Courmont 

Fix another potential audio output dead lock
(cherry picked from commit 2852aba44c5127fea525f348d77fcd82cd326a3f)

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

 src/audio_output/output.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/audio_output/output.c b/src/audio_output/output.c
index 0b0ebfa..e1d0b72 100644
--- a/src/audio_output/output.c
+++ b/src/audio_output/output.c
@@ -338,6 +338,14 @@ aout_buffer_t * aout_OutputNextBuffer( aout_instance_t * p_aout,
 
     p_aout->output.b_starving = 0;
 
+    p_aout->output.fifo.p_first = p_buffer->p_next;
+    if ( p_buffer->p_next == NULL )
+    {
+        p_aout->output.fifo.pp_last = &p_aout->output.fifo.p_first;
+    }
+
+    aout_unlock_output_fifo( p_aout );
+
     if ( !b_can_sleek &&
           ( (p_buffer->start_date - start_date > AOUT_PTS_TOLERANCE)
              || (start_date - p_buffer->start_date > AOUT_PTS_TOLERANCE) ) )
@@ -360,12 +368,5 @@ aout_buffer_t * aout_OutputNextBuffer( aout_instance_t * p_aout,
         aout_unlock_input_fifos( p_aout );
     }
 
-    p_aout->output.fifo.p_first = p_buffer->p_next;
-    if ( p_buffer->p_next == NULL )
-    {
-        p_aout->output.fifo.pp_last = &p_aout->output.fifo.p_first;
-    }
-
-    aout_unlock_output_fifo( p_aout );
     return p_buffer;
 }




More information about the vlc-devel mailing list