]> git.sesse.net Git - vlc/blobdiff - modules/audio_mixer/trivial.c
* AudioOutput.cpp: added sanity tests;
[vlc] / modules / audio_mixer / trivial.c
index 0a7f1a96796dc71ccf20be5e599ae3d52c7f6928..8a160768afcf6700c1f67ac7ee36bdc8aa17a16f 100644 (file)
@@ -2,7 +2,7 @@
  * trivial.c : trivial mixer plug-in (1 input, no downmixing)
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: trivial.c,v 1.9 2002/09/30 21:32:32 massiot Exp $
+ * $Id: trivial.c,v 1.11 2002/11/20 16:43:33 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -24,7 +24,6 @@
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <errno.h>
 #include <stdlib.h>                                      /* malloc(), free() */
 #include <string.h>
 
@@ -73,8 +72,9 @@ static void DoWork( aout_instance_t * p_aout, aout_buffer_t * p_buffer )
 {
     int i = 0;
     aout_input_t * p_input = p_aout->pp_inputs[i];
+    int i_nb_channels = aout_FormatNbChannels( &p_aout->mixer.mixer );
     int i_nb_bytes = p_buffer->i_nb_samples * sizeof(s32)
-                      * p_aout->mixer.mixer.i_channels;
+                      * i_nb_channels;
     byte_t * p_in;
     byte_t * p_out;
 
@@ -93,7 +93,7 @@ static void DoWork( aout_instance_t * p_aout, aout_buffer_t * p_buffer )
                                         - p_in)
                                         + p_input->fifo.p_first->i_nb_samples
                                            * sizeof(s32)
-                                           * p_aout->mixer.mixer.i_channels;
+                                           * i_nb_channels;
 
         if ( i_available_bytes < i_nb_bytes )
         {