Commit 1ad2022a authored by Boris Dorès's avatar Boris Dorès

- correct calculation of the size of the overflow buffer

  (fixes a crash with mono streams)
parent 3fbfb3d4
...@@ -150,7 +150,8 @@ E: babal(at)via.ecp.fr ...@@ -150,7 +150,8 @@ E: babal(at)via.ecp.fr
C: babal C: babal
D: Win32 network input D: Win32 network input
D: Win32 interface D: Win32 interface
D: Headphone channel mixer D: Headphone channel mixer, Dolby Surround decoder
D: Audio output core enhancements
S: France S: France
N: Jean-Marc Dressler N: Jean-Marc Dressler
......
...@@ -315,12 +315,10 @@ static int Init ( aout_filter_t * p_filter , struct aout_filter_sys_t * p_data ...@@ -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++ ) for ( i = 0 ; i < p_data->i_nb_atomic_operations ; i++ )
{ {
if ( p_data->i_overflow_buffer_size if ( p_data->i_overflow_buffer_size
< p_data->p_atomic_operations[i].i_delay * i_nb_channels < p_data->p_atomic_operations[i].i_delay * 2 * sizeof (float) )
* sizeof (float) )
{ {
p_data->i_overflow_buffer_size p_data->i_overflow_buffer_size
= p_data->p_atomic_operations[i].i_delay * i_nb_channels = p_data->p_atomic_operations[i].i_delay * 2 * sizeof (float);
* sizeof (float);
} }
} }
p_data->p_overflow_buffer = malloc ( p_data->i_overflow_buffer_size ); p_data->p_overflow_buffer = malloc ( p_data->i_overflow_buffer_size );
...@@ -402,7 +400,7 @@ static int Create( vlc_object_t *p_this ) ...@@ -402,7 +400,7 @@ static int Create( vlc_object_t *p_this )
if ( Init( p_filter , p_filter->p_sys if ( Init( p_filter , p_filter->p_sys
, aout_FormatNbChannels ( &p_filter->input ) , aout_FormatNbChannels ( &p_filter->input )
, p_filter->input.i_physical_channels , p_filter->input.i_physical_channels
, p_filter->input.i_rate ) < 0 ) , p_filter->input.i_rate ) < 0 )
{ {
return VLC_EGENERIC; return VLC_EGENERIC;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment