]> git.sesse.net Git - vlc/blobdiff - src/audio_output/filters.c
aout_BufferAlloc() : remove stack allocation
[vlc] / src / audio_output / filters.c
index d29352f90118a354ccdd443af68b290985908467..d6972fc3b74b864d56109d5d3241f922aa887fe0 100644 (file)
 # include "config.h"
 #endif
 
+#include <assert.h>
+
 #include <vlc_common.h>
-#include <vlc_interface.h>
+#include <vlc_dialog.h>
 
 #ifdef HAVE_ALLOCA_H
 #   include <alloca.h>
@@ -156,9 +158,9 @@ int aout_FiltersCreatePipeline( aout_instance_t * p_aout,
     if( *pi_nb_filters + 1 > AOUT_MAX_FILTERS )
     {
         msg_Err( p_aout, "max filter reached (%d)", AOUT_MAX_FILTERS );
-        intf_UserFatal( p_aout, false, _("Audio filtering failed"),
-                        _("The maximum number of filters (%d) was reached."),
-                        AOUT_MAX_FILTERS );
+        dialog_Fatal( p_aout, _("Audio filtering failed"),
+                      _("The maximum number of filters (%d) was reached."),
+                      AOUT_MAX_FILTERS );
         return -1;
     }
 
@@ -203,9 +205,9 @@ int aout_FiltersCreatePipeline( aout_instance_t * p_aout,
     {
         ReleaseFilter( pp_filters[0] );
         msg_Err( p_aout, "max filter reached (%d)", AOUT_MAX_FILTERS );
-        intf_UserFatal( p_aout, false, _("Audio filtering failed"),
-                        _("The maximum number of filters (%d) was reached."),
-                        AOUT_MAX_FILTERS );
+        dialog_Fatal( p_aout, _("Audio filtering failed"),
+                      _("The maximum number of filters (%d) was reached."),
+                      AOUT_MAX_FILTERS );
         return -1;
     }
     pp_filters[1] = FindFilter( p_aout, &pp_filters[0]->output,
@@ -226,9 +228,9 @@ int aout_FiltersCreatePipeline( aout_instance_t * p_aout,
         {
             ReleaseFilter( pp_filters[0] );
             msg_Err( p_aout, "max filter reached (%d)", AOUT_MAX_FILTERS );
-            intf_UserFatal( p_aout, false, _("Audio filtering failed"),
-                            _("The maximum number of filters (%d) was reached."),
-                            AOUT_MAX_FILTERS );
+            dialog_Fatal( p_aout, _("Audio filtering failed"),
+                          _("The maximum number of filters (%d) was reached."),
+                          AOUT_MAX_FILTERS );
             return -1;
         }
         pp_filters[1] = FindFilter( p_aout, &pp_filters[0]->output,
@@ -315,14 +317,14 @@ void aout_FiltersHintBuffers( aout_instance_t * p_aout,
             p_first_alloc->i_bytes_per_sec = __MAX(
                                          p_first_alloc->i_bytes_per_sec,
                                          i_input_size );
-            p_filter->output_alloc.i_alloc_type = AOUT_ALLOC_NONE;
+            p_filter->output_alloc.b_alloc = false;
         }
         else
         {
             /* We're gonna need a buffer allocation. */
             memcpy( &p_filter->output_alloc, p_first_alloc,
                     sizeof(aout_alloc_t) );
-            p_first_alloc->i_alloc_type = AOUT_ALLOC_STACK;
+            p_first_alloc->b_alloc = true;
             p_first_alloc->i_bytes_per_sec = i_input_size;
         }
     }
@@ -348,7 +350,7 @@ void aout_FiltersPlay( aout_instance_t * p_aout,
         aout_BufferAlloc( &p_filter->output_alloc,
                           ((mtime_t)(*pp_input_buffer)->i_nb_samples + 2)
                           * 1000000 / p_filter->input.i_rate,
-                          *pp_input_buffer, p_output_buffer );
+                          *pp_input_buffer, &p_output_buffer );
         if( p_output_buffer == NULL )
             return;
 
@@ -371,8 +373,6 @@ void aout_FiltersPlay( aout_instance_t * p_aout,
             *pp_input_buffer = p_output_buffer;
         }
     }
-
-    assert( (*pp_input_buffer) == NULL || (*pp_input_buffer)->i_alloc_type != AOUT_ALLOC_STACK );
 }
 
 /*****************************************************************************