diff --git a/modules/audio_filter/chorus_flanger.c b/modules/audio_filter/chorus_flanger.c<br>index efeade6..f85451d 100644<br>--- a/modules/audio_filter/chorus_flanger.c<br>+++ b/modules/audio_filter/chorus_flanger.c<br>@@ -51,7 +51,6 @@ static block_t *DoWork( filter_t *, block_t * );<br>
struct filter_sys_t<br> {<br> /* TODO: Cleanup and optimise */<br>- int i_cumulative;<br> int i_channels, i_sampleRate;<br> float f_delayTime, f_feedbackGain; /* delayTime is in milliseconds */<br> float f_wetLevel, f_dryLevel;<br>
@@ -59,8 +58,6 @@ struct filter_sys_t<br> <br> float f_step,f_offset;<br> int i_step,i_offset;<br>- float f_temp;<br>- float f_sinMultiplier;<br> <br> /* This data is for the the circular queue which stores the samples. */<br>
int i_bufferLength;<br>@@ -188,24 +185,14 @@ static int Open( vlc_object_t *p_this )<br> return VLC_ENOMEM;<br> }<br> <br>- p_sys->i_cumulative = 0;<br> p_sys->f_step = p_sys->f_sweepRate / 1000.0;<br>
p_sys->i_step = p_sys->f_sweepRate > 0 ? 1 : 0;<br> p_sys->f_offset = 0;<br> p_sys->i_offset = 0;<br>- p_sys->f_temp = 0;<br> <br> p_sys->pf_delayLineEnd = p_sys->pf_delayLineStart + p_sys->i_bufferLength;<br>
p_sys->pf_write = p_sys->pf_delayLineStart;<br> <br>- if( p_sys->f_sweepDepth < small_value() ||<br>- p_filter->fmt_in.audio.i_rate < small_value() ) {<br>- p_sys->f_sinMultiplier = 0.0;<br>
- }<br>- else {<br>- p_sys->f_sinMultiplier = 11 * p_sys->f_sweepRate /<br>- ( 7 * p_sys->f_sweepDepth * p_filter->fmt_in.audio.i_rate ) ;<br>- }<br> p_sys->i_sampleRate = p_filter->fmt_in.audio.i_rate;<br>
<br> return VLC_SUCCESS;<br>@@ -239,7 +226,7 @@ static block_t *DoWork( filter_t *p_filter, block_t *p_in_buf )<br> float *p_out = (float*)p_in_buf->p_buffer;<br> float *p_in = (float*)p_in_buf->p_buffer;<br>
<br>- float *pf_ptr, f_diff = 0, f_frac = 0, f_temp = 0 ;<br>+ float *pf_ptr, f_temp = 0 ;<br> <br> /* Process each sample */<br> for( unsigned i = 0; i < i_samples ; i++ )<br>@@ -269,8 +256,7 @@ static block_t *DoWork( filter_t *p_filter, block_t *p_in_buf )<br>
}<br> /* Calculate position in delay */<br> int offset = floor( p_sys->f_offset );<br>- pf_ptr = p_sys->pf_write + i_maxOffset * p_sys->i_channels +<br>- offset * p_sys->i_channels;<br>
+ pf_ptr = p_sys->pf_write + (i_maxOffset + offset) * p_sys->i_channels;<br> <br> /* Handle Overflow */<br> if( pf_ptr < p_sys->pf_delayLineStart )<br>@@ -282,12 +268,9 @@ static block_t *DoWork( filter_t *p_filter, block_t *p_in_buf )<br>
pf_ptr -= p_sys->i_bufferLength - p_sys->i_channels;<br> }<br> /* For interpolation */<br>- f_frac = ( p_sys->f_offset - (int)p_sys->f_offset );<br> for( i_chan = 0; i_chan < p_sys->i_channels; i_chan++ )<br>
{<br>- f_diff = *( pf_ptr + p_sys->i_channels + i_chan )<br>- - *( pf_ptr + i_chan );<br>- f_temp = ( *( pf_ptr + i_chan ) );//+ f_diff * f_frac);<br>+ f_temp = *( pf_ptr + i_chan );<br>
/*Linear Interpolation. FIXME. This creates LOTS of noise */<br> sanitize(&f_temp);<br> p_out[i_chan] = p_sys->f_dryLevel * p_in[i_chan] +<br><br><br clear="all"><br>-- <br><div>
Regards<br>Sukrit Sangwan</div>
<br>