shithub: sox

Download patch

ref: 054cf0cd422fed33683d48d471b43d0497a4ca09
parent: 115e2fd52890a036e5764d8aeea6abedc8bdc0ac
author: Ulrich Klauer <ulrich@chirlu.de>
date: Mon Jan 23 20:05:42 EST 2012

Only activate multiple output mode with "newfile"

Don't activate multiple output mode if only "restart" is given,
without "newfile". Previously, a command line like
  sox infile.wav outfile.wav trim 0 5 : trim 0 5 swap : restart
was run in multiple output mode, causing the output file name to be
rewritten into "outfile001.wav". At least with ALSA, play would
normally fail due to "default001" not being a known output device.

--- a/src/sox.c
+++ b/src/sox.c
@@ -823,6 +823,7 @@
         continue;
       }
       newline_mode = 1;
+      output_method = sox_multiple;
     }
     else if (strcmp(argv[optstate.ind], "restart") == 0)
     {
@@ -857,7 +858,6 @@
     nuser_effects[eff_chain_count]++;
     if (newline_mode)
     {
-      output_method = sox_multiple;
       eff_chain_count++;
       add_eff_chain();
     }