shithub: sox

Download patch

ref: 50857c46c03a85c72826e819f5e815aad4a4633d
parent: 77360f7193a2ba2e8473bf83609d9462e8cdb617
author: Mans Rullgard <mans@mansr.com>
date: Sat Jul 11 09:43:28 EDT 2020

sox: allow single input file with any combine method

There is no reason to require more than one input file with the merge,
mix, etc combine methods.  All the code works correctly with only one
file, and allowing this simplifies use when the number of files is
unknown.

--- a/src/sox.c
+++ b/src/sox.c
@@ -2931,8 +2931,8 @@
     combine_method = sox_concatenate;
 
   /* Make sure we got at least the required # of input filenames */
-  if (input_count < (size_t)(is_serial(combine_method) ? 1 : 2))
-    usage("Not enough input filenames specified");
+  if (input_count < 1)
+    usage("No input filenames specified");
 
   /* Check for misplaced input/output-specific options */
   for (i = 0; i < input_count; ++i) {