shithub: sox

Download patch

ref: 3abb9be40d25b1ea8ca052098d2ae31a6ff6e450
parent: 8f62fe4772bbb84690c4dba9ccf8c97b556e4509
author: rrt <rrt>
date: Wed Dec 27 13:40:23 EST 2006

vol works with gain of 1

--- a/src/vol.c
+++ b/src/vol.c
@@ -93,19 +93,15 @@
 {
     vol_t vol = (vol_t) effp->priv;
     
-    if (vol->gain == 1)
-      return ST_EFF_NULL;
-
-    if (effp->outinfo.channels != effp->ininfo.channels)
-    {
-        st_warn("VOL cannot handle different channels (in=%d, out=%d)"
+    if (effp->outinfo.channels != effp->ininfo.channels) {
+        st_fail("vol cannot handle different channels (in %d, out %d)"
              " use avg or pan", effp->ininfo.channels, effp->outinfo.channels);
+        return ST_EOF;
     }
 
-    if (effp->outinfo.rate != effp->ininfo.rate)
-    {
-        st_fail("VOL cannot handle different rates (in=%ld, out=%ld)"
-             " use resample or rate", effp->ininfo.rate, effp->outinfo.rate);
+    if (effp->outinfo.rate != effp->ininfo.rate) {
+        st_fail("vol cannot handle different rates (in %ld, out %ld)"
+             " use resample", effp->ininfo.rate, effp->outinfo.rate);
         return ST_EOF;
     }
 
@@ -157,9 +153,7 @@
                             sample = ST_SAMPLE_MIN;
                         vol->limited++;
                 } else
-                {
                         sample = gain * sample;
-                }
 
                 ST_SAMPLE_CLIP_COUNT(sample, effp->clippedCount);
                *obuf++ = sample;