shithub: sox

Download patch

ref: 844206f29d3a4b869106ad64e7d50b2d9466c846
parent: 646335712e4b3a9cf7bb8831ec0ac24e6d06e1ed
author: robs <robs>
date: Sun Dec 10 05:44:41 EST 2006

Removed custom clip counter as it did no more than the builtin one.

--- a/src/README
+++ b/src/README
@@ -48,7 +48,7 @@
 treble		see bass
 trim		n	n
 vibro		n	n
-vol		y	c
+vol		y	y
 
 -v		y	c
 
--- a/src/vol.c
+++ b/src/vol.c
@@ -24,8 +24,6 @@
     double limitergain; /* limiter gain. */
     int limited; /* number of limited values to report. */
     int totalprocessed;
-    
-    int clipped;    /* number of clipped values to report. */
 } * vol_t;
 
 /*
@@ -109,7 +107,6 @@
         return ST_EOF;
     }
 
-    vol->clipped = 0;
     vol->limited = 0;
     vol->totalprocessed = 0;
 
@@ -162,7 +159,7 @@
                         sample = gain * sample;
                 }
 
-                ST_SAMPLE_CLIP_COUNT(sample, vol->clipped);
+                ST_SAMPLE_CLIP_COUNT(sample, effp->clippedCount);
                *obuf++ = sample;
             }
     }
@@ -172,7 +169,7 @@
         for (;len>0; len--)
         {
                 sample = gain * *ibuf++;
-                ST_SAMPLE_CLIP_COUNT(sample, vol->clipped);
+                ST_SAMPLE_CLIP_COUNT(sample, effp->clippedCount);
                 *obuf++ = sample;
         }
     }
@@ -188,13 +185,8 @@
     vol_t vol = (vol_t) effp->priv;
     if (vol->limited)
     {
-        st_warn("VOL limited %d values (%d percent).", 
+        st_warn("limited %d values (%d percent).", 
              vol->limited, (int) (vol->limited * 100.0 / vol->totalprocessed));
-    }
-    if (vol->clipped) 
-    {
-        st_warn("VOL clipped %d values, amplitude gain=%f too high...", 
-             vol->clipped, vol->gain);
     }
     return ST_SUCCESS;
 }