]> git.sesse.net Git - vlc/blobdiff - src/audio_output/mixer.c
Removed the default skin for the skins1 module
[vlc] / src / audio_output / mixer.c
index 43ff4b3f39ada727a1cc9591eea559162634eb19..f7431a1bf772b8a4ee63bc2fd169b96bc15f9f07 100644 (file)
@@ -1,8 +1,8 @@
 /*****************************************************************************
  * mixer.c : audio output mixing operations
  *****************************************************************************
- * Copyright (C) 2002 VideoLAN
- * $Id: mixer.c,v 1.27 2003/01/31 10:14:13 sam Exp $
+ * Copyright (C) 2002-2004 VideoLAN
+ * $Id$
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -43,7 +43,7 @@
  *****************************************************************************/
 int aout_MixerNew( aout_instance_t * p_aout )
 {
-    p_aout->mixer.p_module = module_Need( p_aout, "audio mixer", NULL );
+    p_aout->mixer.p_module = module_Need( p_aout, "audio mixer", NULL, 0 );
     if ( p_aout->mixer.p_module == NULL )
     {
         msg_Err( p_aout, "no suitable aout mixer" );
@@ -189,8 +189,10 @@ static int MixBuffer( aout_instance_t * p_aout )
         }
 
         /* Check for the continuity of start_date */
-        while ( p_buffer != NULL && p_buffer->end_date < start_date )
+        while ( p_buffer != NULL && p_buffer->end_date < start_date - 1 )
         {
+            /* We authorize a +-1 because rounding errors get compensated
+             * regularly. */
             aout_buffer_t * p_next = p_buffer->p_next;
             msg_Warn( p_aout, "the mixer got a packet in the past ("I64Fd")",
                       start_date - p_buffer->end_date );
@@ -259,16 +261,14 @@ static int MixBuffer( aout_instance_t * p_aout )
             {
                 p_input->p_first_byte_to_mix = p_buffer->p_buffer;
             }
-            mixer_nb_bytes = p_input->p_first_byte_to_mix
-                              - p_buffer->p_buffer;
+            mixer_nb_bytes = p_input->p_first_byte_to_mix - p_buffer->p_buffer;
 
             if ( !((i_nb_bytes + p_aout->mixer.mixer.i_bytes_per_frame
                      > mixer_nb_bytes) &&
                    (i_nb_bytes < p_aout->mixer.mixer.i_bytes_per_frame
                      + mixer_nb_bytes)) )
             {
-                msg_Warn( p_aout,
-                          "mixer start isn't output start ("I64Fd")",
+                msg_Warn( p_aout, "mixer start isn't output start ("I64Fd")",
                           i_nb_bytes - mixer_nb_bytes );
 
                 /* Round to the nearest multiple */