]> git.sesse.net Git - vlc/commitdiff
* hd1000a: channel reordering
authorJon Lech Johansen <jlj@videolan.org>
Thu, 18 Mar 2004 16:53:56 +0000 (16:53 +0000)
committerJon Lech Johansen <jlj@videolan.org>
Thu, 18 Mar 2004 16:53:56 +0000 (16:53 +0000)
modules/audio_output/hd1000a.cpp

index f096fc795b7370f2ae5d5c5d2009532546c3d5fa..97f867f624ace034adf7593bc27377507390085d 100644 (file)
@@ -66,6 +66,8 @@ static void    Close       ( vlc_object_t * );
 static void    Play        ( aout_instance_t * );
 static int     Thread      ( aout_instance_t * );
 
+static void    InterleaveS16( int16_t *, int16_t * );
+
 /*****************************************************************************
  * Module descriptor
  *****************************************************************************/
@@ -235,9 +237,8 @@ static int Thread( aout_instance_t * p_aout )
         }
         else
         {
-            p_aout->p_vlc->pf_memcpy( p_sys->ppBuffers[ i ],
-                                      p_buffer->p_buffer,
-                                      p_sys->nBufferSize );
+            InterleaveS16( (int16_t *)p_buffer->p_buffer,
+                           (int16_t *)p_sys->ppBuffers[ i ] );
             aout_BufferFree( p_buffer );
         }
 
@@ -253,3 +254,15 @@ static int Thread( aout_instance_t * p_aout )
 
     return VLC_SUCCESS;
 }
+
+/*****************************************************************************
+ * InterleaveS16: interleave samples
+ *****************************************************************************/
+static void InterleaveS16( int16_t * p_in, int16_t * p_out )
+{
+    for( int i = 0; i < FRAME_SIZE; i++ )
+    {
+        p_out[ i * 2 + 0 ] = p_in[ i * 2 + 1 ];
+        p_out[ i * 2 + 1 ] = p_in[ i * 2 + 0 ];
+    }
+}