shithub: sox

Download patch

ref: 41a2b5a9636d776deee2ebba910ab18ad80a547a
parent: 93aaf4e4cb8cec66173498381398a0981ffae19b
author: robs <robs>
date: Wed Mar 5 16:28:18 EST 2008

fix size not being written for adpcm

--- a/src/wav.c
+++ b/src/wav.c
@@ -1296,18 +1296,8 @@
         dwSamplesWritten = blocksWritten * wSamplesPerBlock;
     } else {    /* fixup with real length */
         dwSamplesWritten = second_header? wav->numSamples : ft->length;
-        switch(wFormatTag)
-        {
-            case WAVE_FORMAT_ADPCM:
-            case WAVE_FORMAT_IMA_ADPCM:
-                dwDataLength = wav->dataLength;
-                break;
-            case WAVE_FORMAT_GSM610:
-                /* intentional case fallthrough! */
-            default:
-                blocksWritten = (dwSamplesWritten+wSamplesPerBlock-1)/wSamplesPerBlock;
-                dwDataLength = blocksWritten * wBlockAlign;
-        }
+        blocksWritten = (dwSamplesWritten+wSamplesPerBlock-1)/wSamplesPerBlock;
+        dwDataLength = blocksWritten * wBlockAlign;
     }
 
     if (wFormatTag == WAVE_FORMAT_GSM610)