shithub: sox

Download patch

ref: c0f7c0ce64ce521c30b7e235373a6babfd4bcf68
parent: 166fe91d0645728370f7ba85f5732baf5d851f8f
author: robs <robs>
date: Wed Sep 9 14:24:51 EDT 2009

default to single threaded

--- a/sox.1
+++ b/sox.1
@@ -862,6 +862,15 @@
 If SoX has been built with the optional `libmagic' library, then this
 option can be given to enable its use in helping to detect audio file types.
 .TP
+\fB\-\-multi-threaded\fR | \fB\-\-single-threaded\fR
+By default, SoX is `single threaded'.
+If the \fB\-\-multi-threaded\fR option is given however then SoX
+will process audio channels for most multi-channel
+effects in parallel on hyper-threading/multi-core architectures; this
+may reduce processing time, though sometimes it may be necessary to use
+this option in conjuction with a larger buffer size than is the default
+(e.g. 131072; see \fB\-\-buffer\fR above).
+.TP
 \fB\-\-no\-clobber\fR
 Prompt before overwriting an existing file with the same name as that
 given for the output file.
@@ -973,12 +982,6 @@
 .SP
 This option is enabled by default when using
 SoX to play or record audio.
-.TP
-\fB\-\-single-threaded\fR
-By default, SoX processes audio channels for most multi-channel
-effects in parallel on hyper-threading/multi-core architectures.  In
-case this should ever cause a problem, parallel processing can be
-disabled by giving this option.
 .TP
 \fB\-\-temp\fI DIRECTORY\fR
 Specify that any temporary files should be created in the given
--- a/src/sox.c
+++ b/src/sox.c
@@ -190,7 +190,7 @@
 
 /* Multi-processing */
 
-static sox_bool single_threaded = sox_false;
+static sox_bool single_threaded = sox_true;
 
 #ifdef HAVE_TERMIOS_H
 #include <termios.h>
@@ -1790,6 +1790,8 @@
 "-m, --combine mix        Mix multiple input files (instead of concatenating)",
 "-M, --combine merge      Merge multiple input files (instead of concatenating)",
 "--magic                  Use `magic' file-type detection",
+"--multi-threaded         Enable parallel effects channels processing (where",
+"                         available)",
 "--norm                   Guard (see --guard) & normalise",
 "--play-rate-arg ARG      Default `rate' argument for auto-resample with `play'",
 "--plot gnuplot|octave    Generate script to plot response of filter effect",
@@ -2017,6 +2019,7 @@
   {"play-rate-arg"   , required_argument, NULL, 0},
   {"clobber"         ,       no_argument, NULL, 0},
   {"no-clobber"      ,       no_argument, NULL, 0},
+  {"multi-threaded"  ,       no_argument, NULL, 0},
 
   {"bits"            , required_argument, NULL, 'b'},
   {"channels"        , required_argument, NULL, 'c'},
@@ -2191,6 +2194,7 @@
       case 21: play_rate_arg = strdup(lsx_optarg); break;
       case 22: no_clobber = sox_false; break;
       case 23: no_clobber = sox_true; break;
+      case 24: single_threaded = sox_false; break;
       }
       break;