Pliki binarne sox.20050917-inst4/src/sox i sox.20050917-inst5/src/sox się różnią
Pliki binarne sox.20050917-inst4/src/soxmix i sox.20050917-inst5/src/soxmix się różnią
diff -ru sox.20050917-inst4/src/wav.c sox.20050917-inst5/src/wav.c
--- sox.20050917-inst4/src/wav.c	2005-09-20 16:18:40.000000000 +0200
+++ sox.20050917-inst5/src/wav.c	2007-01-03 07:13:00.000000000 +0100
@@ -1750,14 +1750,16 @@
 #ifdef ENABLE_GSM
         case WAVE_FORMAT_GSM610:
 	    {	st_size_t	gsmoff;
-		/* dwDataLength is divided by wav->blockAlign in line 859
-		so let's assume blockAlign is in bytes */
-		/* rounding to blockAlign */
-		gsmoff = offset * ft->info.size + wav->blockAlign / 2;
-		gsmoff -= gsmoff % wav->blockAlign;
+		/* rounding bytes to blockAlign */
+		gsmoff = offset * wav->blockAlign / wav->samplesPerBlock + wav->blockAlign * ft->info.channels / 2;
+		gsmoff -= gsmoff % (wav->blockAlign * ft->info.channels);
 		ft->st_errno = st_seek(ft, gsmoff + wav->dataStart, SEEK_SET);
 		if( ft->st_errno == ST_SUCCESS )
-		    wav->numSamples = ft->length - (new_offset / ft->info.size / ft->info.channels);
+		    new_offset = offset;
+		    alignment = offset % wav->samplesPerBlock;	/* offset is in samples */
+		    if (alignment != 0)
+			new_offset += (wav->samplesPerBlock - alignment);
+		    wav->numSamples = ft->length - (new_offset / ft->info.channels);
 		}
 #else
             st_fail_errno(ft,ST_ENOTSUP,"GSM support not compiled in");
@@ -1769,7 +1771,7 @@
             channel_block = ft->info.channels * ft->info.size;
             alignment = new_offset % channel_block;
             /* Most common mistaken is to compute something like
-             * "skip everthing upto and including this sample" so
+             * "skip everything upto and including this sample" so
              * advance to next sample block in this case.
              */
             if (alignment != 0)
Tylko w sox.20050917-inst5/src: wav.c.orig
Tylko w sox.20050917-inst5/src: .wav.c.swp
Pliki binarne sox.20050917-inst4/src/wav.o i sox.20050917-inst5/src/wav.o się różnią
Tylko w sox.20050917-inst5: x.wav
