]> git.sesse.net Git - vlc/blobdiff - modules/audio_filter/resampler/bandlimited.c
LGPL
[vlc] / modules / audio_filter / resampler / bandlimited.c
index 91a2085d2c560efa59cc544e5e111ebf56686415..9e9adbbc5cd58135fa8c5d387494479f784292c7 100644 (file)
@@ -1,24 +1,24 @@
 /*****************************************************************************
  * bandlimited.c : band-limited interpolation resampler
  *****************************************************************************
- * Copyright (C) 2002, 2006 the VideoLAN team
+ * Copyright (C) 2002, 2006 VLC authors and VideoLAN
  * $Id$
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 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
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 /*****************************************************************************
@@ -72,7 +72,7 @@ struct filter_sys_t
     size_t i_buf_size;
 
     double d_old_factor;
-    int i_old_wing;
+    size_t i_old_wing;
 
     unsigned int i_remainder;                /* remainder of previous sample */
     bool b_first;
@@ -87,7 +87,11 @@ vlc_module_begin ()
     set_category( CAT_AUDIO )
     set_subcategory( SUBCAT_AUDIO_MISC )
     set_description( N_("Audio filter for band-limited interpolation resampling") )
-    set_capability( "audio filter", 20 )
+    set_capability( "audio converter", 20 )
+    set_callbacks( OpenFilter, CloseFilter )
+
+    add_submodule()
+    set_capability( "audio resampler", 20 )
     set_callbacks( OpenFilter, CloseFilter )
 vlc_module_end ()
 
@@ -235,6 +239,7 @@ static block_t *Resample( filter_t * p_filter, block_t * p_in_buf )
 
         /* Finalize aout buffer */
         p_out_buf->i_nb_samples = i_out;
+        p_out_buf->i_dts =
         p_out_buf->i_pts = date_Get( &p_sys->end_date );
         p_out_buf->i_length = date_Increment( &p_sys->end_date,
                                       p_out_buf->i_nb_samples ) - p_out_buf->i_pts;
@@ -296,7 +301,7 @@ static int OpenFilter( vlc_object_t *p_this )
     }
 
 #if !defined( SYS_DARWIN )
-    if( !var_InheritInteger( p_this, "hq-resampling" ) )
+    if( !var_InheritBool( p_this, "hq-resampling" ) )
     {
         return VLC_EGENERIC;
     }