]> git.sesse.net Git - vlc/blobdiff - modules/audio_filter/resampler/bandlimited.c
Removes trailing spaces. Removes tabs.
[vlc] / modules / audio_filter / resampler / bandlimited.c
index 2cbe087c665430078710d2797d630ae128c21679..5a5bc99850c9184ad5244650308761b74158fdf0 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * bandlimited.c : band-limited interpolation resampler
  *****************************************************************************
- * Copyright (C) 2002 the VideoLAN team
+ * Copyright (C) 2002, 2006 the VideoLAN team
  * $Id$
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
@@ -10,7 +10,7 @@
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * filter is 13 samples.
  *
  *****************************************************************************/
-#include <stdlib.h>                                      /* malloc(), free() */
-#include <string.h>
 
 #include <vlc/vlc.h>
-#include "audio_output.h"
-#include "aout_internal.h"
+#include <vlc_aout.h>
+
 #include "bandlimited.h"
 
 /*****************************************************************************
@@ -81,7 +79,7 @@ struct aout_filter_sys_t
 vlc_module_begin();
     set_category( CAT_AUDIO );
     set_subcategory( SUBCAT_AUDIO_MISC );
-    set_description( _("audio filter for band-limited interpolation resampling") );
+    set_description( _("Audio filter for band-limited interpolation resampling") );
     set_capability( "audio filter", 20 );
     set_callbacks( Create, Close );
 vlc_module_end();
@@ -106,7 +104,7 @@ static int Create( vlc_object_t *p_this )
         return VLC_EGENERIC;
     }
 
-#if !defined( SYS_DARWIN )
+#if !defined( __APPLE__ )
     if( !config_GetInt( p_this, "hq-resampling" ) )
     {
         return VLC_EGENERIC;
@@ -123,7 +121,7 @@ static int Create( vlc_object_t *p_this )
 
     /* Calculate worst case for the length of the filter wing */
     d_factor = (double)p_filter->output.i_rate
-                        / p_filter->input.i_rate;
+                        / p_filter->input.i_rate / AOUT_MAX_INPUT_RATE;
     i_filter_wing = ((SMALL_FILTER_NMULT + 1)/2.0)
                       * __MAX(1.0, 1.0/d_factor) + 10;
     p_filter->p_sys->i_buf_size = aout_FormatNbChannels( &p_filter->input ) *
@@ -177,7 +175,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
     /* Check if we really need to run the resampler */
     if( p_aout->mixer.mixer.i_rate == p_filter->input.i_rate )
     {
-        if( //p_filter->b_continuity && /* What difference does it make ? :) */
+        if( /*p_filter->b_continuity && /--* What difference does it make ? :) */
             p_filter->p_sys->i_old_wing &&
             p_in_buf->i_size >=
               p_in_buf->i_nb_bytes + p_filter->p_sys->i_old_wing *
@@ -244,11 +242,11 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
     /* Copy all our samples in p_in */
     if( p_filter->p_sys->i_old_wing )
     {
-        p_aout->p_vlc->pf_memcpy( p_in, p_filter->p_sys->p_buf,
+        p_aout->p_libvlc->pf_memcpy( p_in, p_filter->p_sys->p_buf,
                                   p_filter->p_sys->i_old_wing * 2 *
                                   p_filter->input.i_bytes_per_frame );
     }
-    p_aout->p_vlc->pf_memcpy( p_in + p_filter->p_sys->i_old_wing * 2 *
+    p_aout->p_libvlc->pf_memcpy( p_in + p_filter->p_sys->i_old_wing * 2 *
                               i_nb_channels, p_in_buf->p_buffer,
                               p_in_buf->i_nb_samples *
                               p_filter->input.i_bytes_per_frame );
@@ -274,8 +272,8 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
         if( p_filter->p_sys->d_old_factor == 1 )
         {
             /* Just copy the samples */
-            memcpy( p_out, p_in, 
-                    p_filter->input.i_bytes_per_frame );          
+            memcpy( p_out, p_in,
+                    p_filter->input.i_bytes_per_frame );
             p_in += i_nb_channels;
             p_out += i_nb_channels;
             i_out++;