shithub: sox

Download patch

ref: f05d9c5b4d782f48ec481bc299405484550dbc90
parent: 8446fc532f2c32005d7fab57a93f5c0b13e7ad12
author: robs <robs>
date: Sat Oct 25 08:31:30 EDT 2008

fix 'speed'; broken in recent refactorings

--- a/src/sox.c
+++ b/src/sox.c
@@ -1375,11 +1375,6 @@
     combiner_signal.channels =
       combine_method == sox_merge? total_channels : max_channels;
   }
-
-  /* Now take account of any net speed change specified by user effects by
-   * adjusting the nominal sample rate at the output of the combiner: */
-  combiner_signal.rate *= sox_effects_globals.speed;
-
 } /* calculate_combiner_signal_parameters */
 
 static void calculate_output_signal_parameters(void)
@@ -1462,6 +1457,13 @@
   set_combiner_and_output_encoding_parameters();
 
   calculate_output_signal_parameters();
+
+  /* Now take account of any net speed change specified by user effects by
+   * adjusting the nominal sample rate at the output of the combiner.  This
+   * cannot be done inside set_combiner_and_output_encoding_parameters since
+   * it must be done after calculate_output_signal_parameters. */
+  combiner_signal.rate *= sox_effects_globals.speed;
+
   open_output_file();
 
   if (!effects_chain)