[vlc-devel] commit: Fixed bandlimited resampler invalid access when used as an audio filter2 module . (Laurent Aimar )

git version control git at videolan.org
Sun Mar 29 14:17:52 CEST 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sun Mar 29 13:26:40 2009 +0200| [2a9a44ee4d0de8690aa10f1424406d37d76302fb] | committer: 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).

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2a9a44ee4d0de8690aa10f1424406d37d76302fb
---

 modules/audio_filter/resampler/bandlimited.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/audio_filter/resampler/bandlimited.c b/modules/audio_filter/resampler/bandlimited.c
index 8b5d1b0..419fa44 100644
--- a/modules/audio_filter/resampler/bandlimited.c
+++ b/modules/audio_filter/resampler/bandlimited.c
@@ -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 )




More information about the vlc-devel mailing list