[vlc-commits] opensles: move code around

Rafaël Carré git at videolan.org
Sun Jan 22 08:12:47 CET 2012


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Sun Jan 22 01:32:03 2012 -0500| [d8ea040a7cf855c7f0a12f51e6e7794f28561cd9] | committer: Rafaël Carré

opensles: move code around

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

 modules/audio_output/opensles_android.c |  101 +++++++++++++++----------------
 1 files changed, 49 insertions(+), 52 deletions(-)

diff --git a/modules/audio_output/opensles_android.c b/modules/audio_output/opensles_android.c
index 9a2cae9..51db01e 100644
--- a/modules/audio_output/opensles_android.c
+++ b/modules/audio_output/opensles_android.c
@@ -72,8 +72,6 @@ typedef SLresult (*slCreateEngine_t)(
  *****************************************************************************/
 static int  Open        ( vlc_object_t * );
 static void Close       ( vlc_object_t * );
-static void Play        ( audio_output_t *, block_t * );
-static void PlayedCallback ( SLAndroidSimpleBufferQueueItf caller,  void *pContext);
 
 /*****************************************************************************
  * Module descriptor
@@ -124,6 +122,55 @@ static void Clear( aout_sys_t *p_sys )
 }
 
 /*****************************************************************************
+ * Play: play a sound
+ *****************************************************************************/
+static void Play( audio_output_t *p_aout, block_t *p_buffer )
+{
+    aout_sys_t *p_sys = p_aout->sys;
+    int tries = 5;
+
+    for (;;)
+    {
+        SLresult result = (*p_sys->playerBufferQueue)->Enqueue(
+                            p_sys->playerBufferQueue, p_buffer->p_buffer,
+                            p_buffer->i_buffer );
+
+        switch (result)
+        {
+        case SL_RESULT_SUCCESS:
+            p_sys->p_buffer_array[p_sys->i_toappend_buffer] = p_buffer;
+            if( ++p_sys->i_toappend_buffer == BUFF_QUEUE )
+                p_sys->i_toappend_buffer = 0;
+            return;
+
+        case SL_RESULT_BUFFER_INSUFFICIENT:
+            msg_Err( p_aout, "buffer insufficient");
+
+            if (tries--)
+            {
+                // Wait a bit to retry.
+                msleep(CLOCK_FREQ);
+                continue;
+            }
+
+        default:
+            msg_Warn( p_aout, "Error %lu, dropping buffer", result );
+            aout_BufferFree( p_buffer );
+            return;
+        }
+    }
+}
+static void PlayedCallback (SLAndroidSimpleBufferQueueItf caller, void *pContext )
+{
+    aout_sys_t *p_sys = pContext;
+
+    assert (caller == p_sys->playerBufferQueue);
+
+    aout_BufferFree( p_sys->p_buffer_array[p_sys->i_toclean_buffer] );
+    if( ++p_sys->i_toclean_buffer == BUFF_QUEUE )
+        p_sys->i_toclean_buffer = 0;
+}
+/*****************************************************************************
  * Open: open a dummy audio device
  *****************************************************************************/
 static int Open( vlc_object_t *p_this )
@@ -277,53 +324,3 @@ static void Close( vlc_object_t *p_this )
     Clear( p_sys );
 }
 
-/*****************************************************************************
- * Play: play a sound
- *****************************************************************************/
-static void Play( audio_output_t *p_aout, block_t *p_buffer )
-{
-    aout_sys_t *p_sys = p_aout->sys;
-    int tries = 5;
-
-    for (;;)
-    {
-        SLresult result = (*p_sys->playerBufferQueue)->Enqueue(
-                            p_sys->playerBufferQueue, p_buffer->p_buffer,
-                            p_buffer->i_buffer );
-
-        switch (result)
-        {
-        case SL_RESULT_SUCCESS:
-            p_sys->p_buffer_array[p_sys->i_toappend_buffer] = p_buffer;
-            if( ++p_sys->i_toappend_buffer == BUFF_QUEUE )
-                p_sys->i_toappend_buffer = 0;
-            return;
-
-        case SL_RESULT_BUFFER_INSUFFICIENT:
-            msg_Err( p_aout, "buffer insufficient");
-
-            if (tries--)
-            {
-                // Wait a bit to retry.
-                msleep(CLOCK_FREQ);
-                continue;
-            }
-
-        default:
-            msg_Warn( p_aout, "Error %lu, dropping buffer", result );
-            aout_BufferFree( p_buffer );
-            return;
-        }
-    }
-}
-
-static void PlayedCallback (SLAndroidSimpleBufferQueueItf caller, void *pContext )
-{
-    aout_sys_t *p_sys = pContext;
-
-    assert (caller == p_sys->playerBufferQueue);
-
-    aout_BufferFree( p_sys->p_buffer_array[p_sys->i_toclean_buffer] );
-    if( ++p_sys->i_toclean_buffer == BUFF_QUEUE )
-        p_sys->i_toclean_buffer = 0;
-}



More information about the vlc-commits mailing list