Commit 2a9a44ee authored by Laurent Aimar's avatar Laurent Aimar

Fixed bandlimited resampler invalid access when used as an audio filter2 module.

 This modules seems to not resample the first samples (which is not good
at all for an audio filter2 btw). This has to be taken into account when
calculating the output buffer size.
Fixes #1862 and #1962(duplicate).
parent 6a64202e
......@@ -570,8 +570,10 @@ static block_t *Resample( filter_t *p_filter, block_t *p_block )
i_bytes_per_frame = p_filter->fmt_out.audio.i_channels *
p_filter->fmt_out.audio.i_bitspersample / 8;
i_out_size = i_bytes_per_frame * ( 1 + (p_block->i_samples *
p_filter->fmt_out.audio.i_rate / p_filter->fmt_in.audio.i_rate));
i_out_size = i_bytes_per_frame * ( 1 + ( p_block->i_samples *
p_filter->fmt_out.audio.i_rate /
p_filter->fmt_in.audio.i_rate) ) +
p_filter->p_sys->i_buf_size;
p_out = p_filter->pf_audio_buffer_new( p_filter, i_out_size );
if( !p_out )
......
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