shithub: sox

Download patch

ref: dabfcd802e43e873e16e93321c158083704500da
parent: 7a26182e97e2c727e80dfa4a1217421156091092
author: cbagwell <cbagwell>
date: Sun Aug 18 15:06:24 EDT 2002

Various bugfixes

--- a/Changelog
+++ b/Changelog
@@ -7,8 +7,8 @@
 sox-12.17.4
 -----------
   o Peter Nyhlen fixed a problem with reading Comments in Ogg Vorbis files.
-  o Added install target to allow installing libgsm from main Makefile
-    (Leigh Smith).
+  o Added install target to allow installing libgsm from main Makefile.
+    Leigh Smith.
   o Minor updates to sox.c to free unused memory and close all input
     files during failures.
   o Pieter Krul added a patch that makes play script look at AUDIODEV
@@ -28,6 +28,10 @@
     private sizes being to small.
   o Jimen Ching adds -d option to specify 64bit data size and changed
     Ulaw/Alaw encoding to default to 8bit data size if not specified.
+  o David Singer pointed out that a MS program creates AIFF files
+    with an invalid length of 0 in its header.  Changed SoX to warn the
+    user but continue instead of aborting since SoX can still read
+    the file just fine.
   o Bert van Leeuwen added a file handler for Psion record.app used
     for System/Alarms in some Psion devices.
 
--- a/sox.1
+++ b/sox.1
@@ -40,7 +40,7 @@
 .B Format options:
 .br
     [ -t \fIfiletype\fR ] [ -r \fIrate\fR ] [ -s/-u/-U/-A/-a/-i/-g/-f ]
-    [ -b/-w/-l ]
+    [ -b/-w/-l/-d ]
     [ -c \fIchannels\fR ] [ -x ] [ -e ]
 .P
 .B Effects:
@@ -262,8 +262,9 @@
 European countries and its gaining popularity because of its
 quality.  It usually is CPU intensive to work with GSM audio data.
 .TP 10
-\fB-b/-w/-l\fR
-The sample data size is in bytes, 16-bit words, or 32-bit long words.
+\fB-b/-w/-l/-d\fR
+The sample data size is in bytes, 16-bit words, 32-bit long words, 
+or 64-bit double long (long long) words.
 .TP 10
 \fB-x\fR
 The sample data is in XINU format; that is,
--- a/src/aiff.c
+++ b/src/aiff.c
@@ -356,10 +356,8 @@
 	}
 	/* SSND chunk just read */
 	if (blocksize != 0)
-	{
-		st_fail_errno(ft,ST_EHDR,"AIFF header specifies nonzero blocksize?!?!");
-		return(ST_EOF);
-	}
+	    st_warn("AIFF header has invalid blocksize.  Ignoring but expect a premature EOF");
+
 	while (offset-- > 0) {
 		if (st_readb(ft, (unsigned char *)&trash8) == ST_EOF)
 		{
--- a/src/avg.c
+++ b/src/avg.c
@@ -218,7 +218,7 @@
              break;
          case MIX_FRONT:
              if (ichan < 4) {
-                 st_fail("Input must have at four channels to use avg -f");
+                 st_fail("Input must have at least four channels to use avg -f");
                  return(ST_EOF);
              }
              pans[0] = 1.0;
@@ -227,7 +227,7 @@
              break;
          case MIX_BACK:
              if (ichan < 4) {
-                 st_fail("Input must have at four channels to use avg -b");
+                 st_fail("Input must have at least four channels to use avg -b");
                  return(ST_EOF);
              }
              pans[0] = 0.0;
@@ -300,7 +300,6 @@
      else if (avg->num_pans == 2) {
          if (ichan == 2 && ochan == 1) {
              avg->sources[0][0] = pans[0];
-             avg->sources[0][1] = 0.0;
              avg->sources[1][0] = pans[1];
          }
          else if (ichan == 4 && ochan == 2) {
@@ -324,16 +323,11 @@
              /* Shorthand for 2-channel case */
              avg->sources[0][0] = pans[0];
              avg->sources[0][1] = pans[1];
-             avg->sources[0][2] = 0.0;
-             avg->sources[0][3] = 0.0;
              avg->sources[1][0] = pans[2];
              avg->sources[1][1] = pans[3];
          }
          else if (ichan == 4 && ochan == 1) {
              avg->sources[0][0] = pans[0];
-             avg->sources[0][1] = 0.0;
-             avg->sources[0][2] = 0.0;
-             avg->sources[0][3] = 0.0;
              avg->sources[1][0] = pans[1];
              avg->sources[2][0] = pans[2];
              avg->sources[3][0] = pans[3];