This might explain the audio-core crashes we have seen in the past on Mac OS X
* Fix issues with platforms which don't have alloca() (defined)
#define AOUT_ALLOC_STACK 1
#define AOUT_ALLOC_HEAP 2
+#if defined( __APPLE__ ) || defined( SYS_BSD )
+#undef HAVE_ALLOCA
+#endif
+
#ifdef HAVE_ALLOCA
# define ALLOCA_TEST( p_alloc, p_new_buffer ) \
if ( (p_alloc)->i_alloc_type == AOUT_ALLOC_STACK ) \
aout_buffer_t * p_in_buf, aout_buffer_t * p_out_buf )
{
filter_sys_t *p_sys = (filter_sys_t *)p_filter->p_sys;
- float *p_in, *p_out = (float *)p_out_buf->p_buffer;
+ float *p_in_orig, *p_in, *p_out = (float *)p_out_buf->p_buffer;
float *p_prev_sample = (float *)p_sys->p_prev_sample;
int i_nb_channels = aout_FormatNbChannels( &p_filter->input );
else
{
/* msg dbg relative ? */
- char *psz_absolute = alloca( strlen( p_demux->psz_access ) + 3 + strlen( p_demux->psz_path ) + strlen( psz_ref ) + 1);
+ int i_path_size = strlen( p_demux->psz_access ) + 3 +
+ strlen( p_demux->psz_path ) + strlen( psz_ref ) + 1;
+#ifdef HAVE_ALLOCA
+ char *psz_absolute = alloca( i_path_size );
+#else
+ char *psz_absolute = (char *)malloc( i_path_size );
+#endif
char *end = strrchr( p_demux->psz_path, '/' );
if( end )
b_play = VLC_TRUE;
}
}
+#ifndef HAVE_ALLOCA
+ free( psz_absolute );
+#endif
}
}
else