]> git.sesse.net Git - vlc/blobdiff - modules/audio_filter/normvol.c
macosx: Fix a memleak.
[vlc] / modules / audio_filter / normvol.c
index 05886c44f72a73eb274a3079c41d23207a099fc8..0c57c0b97acc844c9ebfd8b3937f8078bbef185b 100644 (file)
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <stdlib.h>                                      /* malloc(), free() */
-#include <string.h>
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
 #include <errno.h>                                                 /* ENOMEM */
-#include <stdio.h>
 #include <ctype.h>
 #include <signal.h>
 
 #include <math.h>
 
 
-#include <vlc/vlc.h>
-#include <vlc/aout.h>
+#include <vlc_common.h>
+#include <vlc_plugin.h>
 
-#include <aout_internal.h>
+#include <vlc_aout.h>
 
 /*****************************************************************************
  * Local prototypes
@@ -79,15 +80,15 @@ typedef struct aout_filter_sys_t
                "between 0.5 and 10 seems sensible." )
 
 vlc_module_begin();
-    set_description( _("Volume normalizer") );
-    set_shortname( _("Volume normalizer") );
+    set_description( N_("Volume normalizer") );
+    set_shortname( N_("Volume normalizer") );
     set_category( CAT_AUDIO );
     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();
@@ -98,14 +99,14 @@ 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;
 
     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" );
@@ -113,7 +114,7 @@ static int Open( vlc_object_t *p_this )
 
     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" );
@@ -125,7 +126,7 @@ static int Open( vlc_object_t *p_this )
     }
 
     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 );
 
@@ -243,7 +244,7 @@ static void Close( vlc_object_t *p_this )
 
     if( p_sys )
     {
-        if( p_sys->p_last) free( p_sys->p_last );
+        free( p_sys->p_last );
         free( p_sys );
     }
 }