shithub: sox

Download patch

ref: ffc11e800e271c0ed38284fdd114507253c7112d
parent: 7793ebb29dc92e5ec10a4dc0deb51d6aa56eb9eb
author: robs <robs>
date: Thu Feb 12 15:32:05 EST 2009

let wavpcm apply to chans > 2 (as well as bits > 16)

--- a/src/wav.c
+++ b/src/wav.c
@@ -1351,10 +1351,10 @@
     }
 
     if (wFormatTag == WAVE_FORMAT_GSM610)
-        dwDataLength = (dwDataLength+1) & ~1u; /*round up to even */
+        dwDataLength = (dwDataLength+1) & ~1u; /* round up to even */
 
-    if ((wFormatTag == WAVE_FORMAT_PCM && wBitsPerSample > 16 && strcmp(ft->filetype, "wavpcm")) || wChannels > 2)
-    {
+    if (wFormatTag == WAVE_FORMAT_PCM && (wBitsPerSample > 16 || wChannels > 2)
+        && strcmp(ft->filetype, "wavpcm")) {
       isExtensible = sox_true;
       wFmtSize += 2 + 22;
     }