Commit be3d7a79 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

visual: Fix bad function return value cast.

parent cb8d3814
...@@ -487,8 +487,11 @@ int spectrometer_Run(visual_effect_t * p_effect, aout_instance_t *p_aout, ...@@ -487,8 +487,11 @@ int spectrometer_Run(visual_effect_t * p_effect, aout_instance_t *p_aout,
p_buffs = p_s16_buff; p_buffs = p_s16_buff;
} }
fft_perform( p_buffer1, p_output, p_state); fft_perform( p_buffer1, p_output, p_state);
for(i= 0; i< FFT_BUFFER_SIZE ; i++ ) for(i = 0; i < FFT_BUFFER_SIZE; i++)
p_dest[i] = ( (int) sqrt( p_output [ i ] ) ) >> 8; {
int sqrti = sqrt(p_output[i]);
p_dest[i] = sqrti >> 8;
}
i_nb_bands *= i_sections; i_nb_bands *= i_sections;
...@@ -504,7 +507,8 @@ int spectrometer_Run(visual_effect_t * p_effect, aout_instance_t *p_aout, ...@@ -504,7 +507,8 @@ int spectrometer_Run(visual_effect_t * p_effect, aout_instance_t *p_aout,
y >>=7;/* remove some noise */ y >>=7;/* remove some noise */
if( y != 0) if( y != 0)
{ {
height[i] = (int)log(y)* y_scale; int logy = log(y);
height[i] = logy * y_scale;
if(height[i] > 150) if(height[i] > 150)
height[i] = 150; height[i] = 150;
} }
......
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