[vlc-commits] float32 mixer: small simplification
Rémi Denis-Courmont
git at videolan.org
Mon May 30 17:21:05 CEST 2011
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon May 30 17:50:32 2011 +0300| [b92aee833edba267d6e5a2859ff75eb37e68437e] | committer: Rémi Denis-Courmont
float32 mixer: small simplification
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b92aee833edba267d6e5a2859ff75eb37e68437e
---
modules/audio_mixer/float32.c | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/modules/audio_mixer/float32.c b/modules/audio_mixer/float32.c
index 435872f..a391cd4 100644
--- a/modules/audio_mixer/float32.c
+++ b/modules/audio_mixer/float32.c
@@ -77,7 +77,7 @@ static int Create( vlc_object_t *p_this )
static void ScaleWords( float * p_out, const float * p_in, size_t i_nb_words,
float f_multiplier )
{
- for( size_t i = i_nb_words; i--; )
+ for( size_t i = 0; i < i_nb_words; i++ )
*p_out++ = *p_in++ * f_multiplier;
}
@@ -110,9 +110,7 @@ static void DoWork( aout_mixer_t * p_mixer, aout_buffer_t * p_buffer )
{
aout_buffer_t * p_old_buffer;
- if( i_available_words > 0 )
- ScaleWords( p_out, p_in, i_available_words, f_multiplier );
-
+ ScaleWords( p_out, p_in, i_available_words, f_multiplier );
i_nb_words -= i_available_words;
p_out += i_available_words;
@@ -128,8 +126,7 @@ static void DoWork( aout_mixer_t * p_mixer, aout_buffer_t * p_buffer )
}
else
{
- if( i_nb_words > 0 )
- ScaleWords( p_out, p_in, i_nb_words, f_multiplier );
+ ScaleWords( p_out, p_in, i_nb_words, f_multiplier );
p_input->begin = (void *)(p_in + i_nb_words);
break;
}
More information about the vlc-commits
mailing list