* all: added a new access_filter module: record + one hotkey to start/stop
[vlc.git] / modules / audio_output / hd1000a.cpp
index f096fc7..28a3627 100644 (file)
@@ -66,12 +66,17 @@ 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
  *****************************************************************************/
 vlc_module_begin();
-    set_description( N_("HD1000 audio output") );
+    set_shortname( "Roku HD1000" );
+    set_description( N_("Roku HD1000 audio output") );
     set_capability( "audio output", 100 );
+    set_category( CAT_AUDIO );
+    set_subcategory( SUBCAT_AUDIO_AOUT );
     set_callbacks( Open, Close );
 vlc_module_end();
 
@@ -235,9 +240,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 +257,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 ];
+    }
+}