]> git.sesse.net Git - vlc/blobdiff - modules/audio_filter/resampler/linear.c
Backport latest fix on the linear resampler.
[vlc] / modules / audio_filter / resampler / linear.c
index 3ac2f89f8202cfb8f8c516d9c31baa8a7e2e2ec8..3359b817678d5b7be92b9426b01ada839334be05 100644 (file)
@@ -1,11 +1,11 @@
 /*****************************************************************************
  * linear.c : linear interpolation resampler
  *****************************************************************************
- * Copyright (C) 2002 VideoLAN
+ * Copyright (C) 2002 the VideoLAN team
  * $Id$
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
- *          Sigmund Augdal <sigmunau@idi.ntnu.no>
+ *          Sigmund Augdal Helberg <dnumgis@videolan.org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -188,7 +188,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
             {
                 i_chan--;
                 p_out[i_chan] = p_prev_sample[i_chan];
-                p_out[i_chan] += ( (p_prev_sample[i_chan] - p_in[i_chan])
+                p_out[i_chan] += ( ( p_in[i_chan] - p_prev_sample[i_chan] )
                                    * p_sys->i_remainder
                                    / p_filter->output.i_rate );
             }
@@ -209,8 +209,8 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
             {
                 i_chan--;
                 p_out[i_chan] = p_in[i_chan];
-                p_out[i_chan] += ( (p_in[i_chan] -
-                    p_in[i_chan + i_nb_channels])
+                p_out[i_chan] += ( ( p_in[i_chan + i_nb_channels]
+                    - p_in[i_chan] )
                     * p_sys->i_remainder / p_filter->output.i_rate );
             }
             p_out += i_nb_channels;