[vlc-commits] AudioQueue: fixed compilation

Philippe Coent git at videolan.org
Fri Mar 23 00:18:13 CET 2012


vlc | branch: master | Philippe Coent <philippe.coent at gmail.com> | Wed Mar 21 18:37:03 2012 +0100| [5482b9b040bbdac91b1b9beb863628d70e91d3fd] | committer: Felix Paul Kühne

AudioQueue: fixed compilation

Signed-off-by: Felix Paul Kühne <fkuehne at videolan.org>

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

 modules/audio_output/audioqueue.c |   29 ++++++++++++++++++++++++++---
 1 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/modules/audio_output/audioqueue.c b/modules/audio_output/audioqueue.c
index f7e5c53..f427a5f 100644
--- a/modules/audio_output/audioqueue.c
+++ b/modules/audio_output/audioqueue.c
@@ -36,6 +36,7 @@
 #include <AudioToolBox/AudioToolBox.h>
 
 #define NUMBER_OF_BUFFERS 3
+#define FRAME_SIZE 2048
 
 /*****************************************************************************
  * aout_sys_t: AudioQueue audio output method descriptor
@@ -133,6 +134,22 @@ static int Open ( vlc_object_t *p_this )
 }
 
 /*****************************************************************************
+  * aout_FifoPop : get the next buffer out of the FIFO
+  *****************************************************************************/
+static aout_buffer_t *aout_FifoPop2( aout_fifo_t * p_fifo )
+ {
+     aout_buffer_t *p_buffer = p_fifo->p_first;
+     if( p_buffer != NULL )
+     {
+         p_fifo->p_first = p_buffer->p_next;
+         if( p_fifo->p_first == NULL )
+             p_fifo->pp_last = &p_fifo->p_first;
+     }
+     return p_buffer;
+ }
+
+
+/*****************************************************************************
  * Close: close the audio device
  *****************************************************************************/
 static void Close ( vlc_object_t *p_this )
@@ -153,9 +170,15 @@ void AudioQueueCallback(void * inUserData, AudioQueueRef inAQ, AudioQueueBufferR
     aout_buffer_t *   p_buffer = NULL;
 
     if (p_aout) {
-        vlc_mutex_lock( &p_aout->lock );
-        p_buffer = aout_FifoPop( &p_aout->fifo );
-        vlc_mutex_unlock( &p_aout->lock );
+        struct aout_sys_t * p_sys = p_aout->sys;
+        aout_packet_t * packet = &p_sys->packet;
+
+        if (packet)
+        {
+            vlc_mutex_lock( &packet->lock );
+            p_buffer = aout_FifoPop2( &packet->fifo );
+            vlc_mutex_unlock( &packet->lock );
+        }
     }
 
     if ( p_buffer != NULL ) {



More information about the vlc-commits mailing list