]> git.sesse.net Git - vlc/blobdiff - modules/audio_filter/channel_mixer/headphone.c
Fix previous commit. Sorry (messed up with Git squash)
[vlc] / modules / audio_filter / channel_mixer / headphone.c
index 668cd8cd01850d015e34c96a3a8392d5ba13185b..992541410b9b4365e823f0b1d4dd85fdd2954460 100644 (file)
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <math.h>                                        /* sqrt */
 
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
 
+#include <math.h>                                        /* sqrt */
+
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_aout.h>
@@ -245,10 +246,7 @@ static int Init( vlc_object_t *p_this, struct aout_filter_sys_t * p_data
     p_data->p_atomic_operations = malloc( sizeof(struct atomic_operation_t)
             * p_data->i_nb_atomic_operations );
     if( p_data->p_atomic_operations == NULL )
-    {
-        msg_Err( p_this, "out of memory" );
         return -1;
-    }
 
     /* For each virtual speaker, computes elementary wave propagation time
      * to each ear */
@@ -346,10 +344,7 @@ static int Init( vlc_object_t *p_this, struct aout_filter_sys_t * p_data
     }
     p_data->p_overflow_buffer = malloc( p_data->i_overflow_buffer_size );
     if( p_data->p_atomic_operations == NULL )
-    {
-        msg_Err( p_this, "out of memory" );
         return -1;
-    }
     memset( p_data->p_overflow_buffer, 0 , p_data->i_overflow_buffer_size );
 
     /* end */
@@ -411,10 +406,7 @@ static int Create( vlc_object_t *p_this )
     /* Allocate the memory needed to store the module's structure */
     p_filter->p_sys = malloc( sizeof(struct aout_filter_sys_t) );
     if( p_filter->p_sys == NULL )
-    {
-        msg_Err( p_filter, "out of memory" );
-        return VLC_EGENERIC;
-    }
+        return VLC_ENOMEM;
     p_filter->p_sys->i_overflow_buffer_size = 0;
     p_filter->p_sys->p_overflow_buffer = NULL;
     p_filter->p_sys->i_nb_atomic_operations = 0;
@@ -626,10 +618,7 @@ static int OpenFilter( vlc_object_t *p_this )
     /* Allocate the memory needed to store the module's structure */
     p_filter->p_sys = malloc( sizeof(struct filter_sys_t) );
     if( p_filter->p_sys == NULL )
-    {
-        msg_Err( p_filter, "out of memory" );
-        return VLC_EGENERIC;
-    }
+        return VLC_ENOMEM;
     p_filter->p_sys->i_overflow_buffer_size = 0;
     p_filter->p_sys->p_overflow_buffer = NULL;
     p_filter->p_sys->i_nb_atomic_operations = 0;
@@ -680,7 +669,8 @@ static block_t *Convert( filter_t *p_filter, block_t *p_block )
 
     if( !p_block || !p_block->i_samples )
     {
-        if( p_block ) p_block->pf_release( p_block );
+        if( p_block )
+            block_Release( p_block );
         return NULL;
     }
 
@@ -692,7 +682,7 @@ static block_t *Convert( filter_t *p_filter, block_t *p_block )
     if( !p_out )
     {
         msg_Warn( p_filter, "can't get output buffer" );
-        if( p_block ) p_block->pf_release( p_block );
+        block_Release( p_block );
         return NULL;
     }
 
@@ -720,6 +710,6 @@ static block_t *Convert( filter_t *p_filter, block_t *p_block )
     p_out->i_buffer = out_buf.i_nb_bytes;
     p_out->i_samples = out_buf.i_nb_samples;
 
-    if( p_block ) p_block->pf_release( p_block );
+    block_Release( p_block );
     return p_out;
 }