From 1ad2022a9d5d65173ad85c9b28d1f7237a8a8d79 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Boris=20Dor=C3=A8s?= Date: Sun, 11 Dec 2005 21:11:46 +0000 Subject: [PATCH] - correct calculation of the size of the overflow buffer (fixes a crash with mono streams) --- AUTHORS | 3 ++- modules/audio_filter/channel_mixer/headphone.c | 8 +++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/AUTHORS b/AUTHORS index 04fd3cb373..f237432b60 100644 --- a/AUTHORS +++ b/AUTHORS @@ -150,7 +150,8 @@ E: babal(at)via.ecp.fr C: babal D: Win32 network input D: Win32 interface -D: Headphone channel mixer +D: Headphone channel mixer, Dolby Surround decoder +D: Audio output core enhancements S: France N: Jean-Marc Dressler diff --git a/modules/audio_filter/channel_mixer/headphone.c b/modules/audio_filter/channel_mixer/headphone.c index da3762fc3a..902559268e 100644 --- a/modules/audio_filter/channel_mixer/headphone.c +++ b/modules/audio_filter/channel_mixer/headphone.c @@ -315,12 +315,10 @@ static int Init ( aout_filter_t * p_filter , struct aout_filter_sys_t * p_data for ( i = 0 ; i < p_data->i_nb_atomic_operations ; i++ ) { if ( p_data->i_overflow_buffer_size - < p_data->p_atomic_operations[i].i_delay * i_nb_channels - * sizeof (float) ) + < p_data->p_atomic_operations[i].i_delay * 2 * sizeof (float) ) { p_data->i_overflow_buffer_size - = p_data->p_atomic_operations[i].i_delay * i_nb_channels - * sizeof (float); + = p_data->p_atomic_operations[i].i_delay * 2 * sizeof (float); } } p_data->p_overflow_buffer = malloc ( p_data->i_overflow_buffer_size ); @@ -402,7 +400,7 @@ static int Create( vlc_object_t *p_this ) if ( Init( p_filter , p_filter->p_sys , aout_FormatNbChannels ( &p_filter->input ) , p_filter->input.i_physical_channels - , p_filter->input.i_rate ) < 0 ) + , p_filter->input.i_rate ) < 0 ) { return VLC_EGENERIC; } -- 2.39.5