shithub: sox

Download patch

ref: 6492a6fc36495adf03a2e36e9474f359edbf32a3
parent: a21ca54128f8579863009f04b536c3da3ad75e31
author: Mans Rullgard <mans@mansr.com>
date: Mon Aug 3 18:19:31 EDT 2020

mp3: remove unused clip counter

--- a/src/mp3.c
+++ b/src/mp3.c
@@ -1137,7 +1137,7 @@
   return(SOX_SUCCESS);
 }
 
-#define MP3_SAMPLE_TO_FLOAT(d,clips) ((float)(32768*SOX_SAMPLE_TO_FLOAT_32BIT(d,clips)))
+#define MP3_SAMPLE_TO_FLOAT(d) ((float)(32768*SOX_SAMPLE_TO_FLOAT_32BIT(d,)))
 
 static size_t sox_mp3write(sox_format_t * ft, const sox_sample_t *buf, size_t samp)
 {
@@ -1147,7 +1147,6 @@
     int nsamples = samp/ft->signal.channels;
     int i,j;
     int written = 0;
-    int clips = 0;
     SOX_SAMPLE_LOCALS;
 
     new_buffer_size = samp * sizeof(float);
@@ -1167,7 +1166,7 @@
     {
         size_t s;
         for(s = 0; s < samp; s++)
-            buffer_l[s] = SOX_SAMPLE_TO_FLOAT_32BIT(buf[s], clips);
+            buffer_l[s] = SOX_SAMPLE_TO_FLOAT_32BIT(buf[s],);
     }
     else
     {
@@ -1180,8 +1179,8 @@
             j=0;
             for (i = 0; i < nsamples; i++)
             {
-                buffer_l[i] = MP3_SAMPLE_TO_FLOAT(buf[j++], clips);
-                buffer_r[i] = MP3_SAMPLE_TO_FLOAT(buf[j++], clips);
+                buffer_l[i] = MP3_SAMPLE_TO_FLOAT(buf[j++]);
+                buffer_r[i] = MP3_SAMPLE_TO_FLOAT(buf[j++]);
             }
         }
         else
@@ -1188,7 +1187,7 @@
         {
             j=0;
             for (i = 0; i < nsamples; i++) {
-                buffer_l[i] = MP3_SAMPLE_TO_FLOAT(buf[j++], clips);
+                buffer_l[i] = MP3_SAMPLE_TO_FLOAT(buf[j++]);
             }
         }
     }