shithub: sox

Download patch

ref: a29c8a5fa92314ef28292f0cf5d56cc49c45bb96
parent: 27ea352ac4bb1955378d29e9f2fdbe9a8c589a31
author: Ulrich Klauer <ulrich@chirlu.de>
date: Mon Jan 23 04:38:13 EST 2012

Use lsx_padbytes() instead of writing 0 directly

--- a/src/wav.c
+++ b/src/wav.c
@@ -1539,9 +1539,8 @@
 
         /* Add a pad byte if the number of data bytes is odd.
            See wavwritehdr() above for the calculation. */
-        if (wav->formatTag != WAVE_FORMAT_GSM610 &&
-            ((wav->numSamples + wav->samplesPerBlock - 1)/wav->samplesPerBlock*wav->blockAlign) % 2)
-          lsx_writeb(ft, 0);
+        if (wav->formatTag != WAVE_FORMAT_GSM610)
+          lsx_padbytes(ft, ((wav->numSamples + wav->samplesPerBlock - 1)/wav->samplesPerBlock*wav->blockAlign) % 2);
 
         free(wav->packet);
         free(wav->samples);