/*****************************************************************************
* Preamble
*****************************************************************************/
-#include <stdlib.h> /* malloc(), free() */
-#include <string.h>
#include <errno.h> /* ENOMEM */
-#include <stdio.h>
#include <ctype.h>
#include <signal.h>
#include <math.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include <vlc/vlc.h>
-#include <vlc/aout.h>
-#include <aout_internal.h>
+#include <vlc_aout.h>
/*****************************************************************************
* Local prototypes
set_subcategory( SUBCAT_AUDIO_AFILTER );
add_shortcut( "volnorm" );
add_integer( "norm-buff-size", 20 ,NULL ,BUFF_TEXT, BUFF_LONGTEXT,
- VLC_TRUE);
+ true);
add_float( "norm-max-level", 2.0, NULL, LEVEL_TEXT,
- LEVEL_LONGTEXT, VLC_TRUE );
+ LEVEL_LONGTEXT, true );
set_capability( "audio filter", 0 );
set_callbacks( Open, Close );
vlc_module_end();
static int Open( vlc_object_t *p_this )
{
aout_filter_t *p_filter = (aout_filter_t*)p_this;
- vlc_bool_t b_fit = VLC_TRUE;
+ bool b_fit = true;
int i_channels;
- aout_filter_sys_t *p_sys = p_filter->p_sys =
- malloc( sizeof( aout_filter_sys_t ) );
+ aout_filter_sys_t *p_sys;
if( p_filter->input.i_format != VLC_FOURCC('f','l','3','2' ) ||
p_filter->output.i_format != VLC_FOURCC('f','l','3','2') )
{
- b_fit = VLC_FALSE;
+ b_fit = false;
p_filter->input.i_format = VLC_FOURCC('f','l','3','2');
p_filter->output.i_format = VLC_FOURCC('f','l','3','2');
msg_Warn( p_filter, "bad input or output format" );
if ( !AOUT_FMTS_SIMILAR( &p_filter->input, &p_filter->output ) )
{
- b_fit = VLC_FALSE;
+ b_fit = false;
memcpy( &p_filter->output, &p_filter->input,
sizeof(audio_sample_format_t) );
msg_Warn( p_filter, "input and output formats are not similar" );
}
p_filter->pf_do_work = DoWork;
- p_filter->b_in_place = VLC_TRUE;
+ p_filter->b_in_place = true;
i_channels = aout_FormatNbChannels( &p_filter->input );
+ p_sys = p_filter->p_sys = malloc( sizeof( aout_filter_sys_t ) );
p_sys->i_nb = var_CreateGetInteger( p_filter->p_parent, "norm-buff-size" );
p_sys->f_max = var_CreateGetFloat( p_filter->p_parent, "norm-max-level" );
if( p_sys )
{
- if( p_sys->p_last) free( p_sys->p_last );
+ free( p_sys->p_last );
free( p_sys );
}
}