ref: 2f07e582fdfba01c7f86203b72bd86399287f907
parent: 9b5acb4f60486cce2099af5d81625d7808eaa5fd
parent: 88edc75a9bc23acf78ddfaa56fc70863b46c548e
author: Ulrich Klauer <ulrich@chirlu.de>
date: Sun Jan 13 20:10:17 EST 2013
Merge branch 'dot' into master Get the fixes from dot into the master branch.
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -82,6 +82,7 @@
check_include_files("stdint.h" HAVE_STDINT_H)
check_include_files("string.h" HAVE_STRING_H)
check_include_files("strings.h" HAVE_STRINGS_H)
+check_include_files("sys/stat.h" HAVE_SYS_STAT_H)
check_include_files("sys/time.h" HAVE_SYS_TIME_H)
check_include_files("sys/timeb.h" HAVE_SYS_TIMEB_H)
check_include_files("sys/types.h" HAVE_SYS_TYPES_H)
--- a/ChangeLog
+++ b/ChangeLog
@@ -55,6 +55,7 @@
ated in [F(ormat)] [E(ffect)] Replacement due after
------- ---------------------- ---------------------- -------
14.4.1 OpenMP < 3.0 OpenMP >= 3.0 14.4.1
+ 14.4.1 F ffmpeg ffmpeg/avconf via pipe 14.4.1
File formats:
@@ -63,6 +64,9 @@
o Fix crash when seeking within a FLAC file. [3476843] (Eric Wong)
o Fix Ogg Vorbis files with certain numbers of channels being
truncated. (Ulrich Klauer)
+ o Fix reading 64-bit float WAVs. [3481510] (nu774 and Ulrich Klauer)
+ o Fix potential buffer overrun when writing FLAC files directly via
+ sox_write(). [3474924] (Eric Wong)
Audio device drivers:
@@ -73,11 +77,17 @@
o Restore 8 seconds default for spectrogram, if the input length is
not known. (Ulrich Klauer)
+ o Set output length for splice to unknown instead of 0. (Ulrich Klauer)
+ o Increase maximum width for spectrograms. (Ulrich Klauer)
+ o Fix memory leaks in LADSPA effect. (Eric Wong)
+ o Fix hang in several effects (rate, tempo, and those based on
+ dft_filter) when processing long files. [3592482, 3594822] (MrMod)
Other bug fixes:
o Fix input length calculation for combine methods other than
concatenate. (Ulrich Klauer)
+ o Fix to configure.ac to work with Autoconf 2.69. [3600293] (cbagwell)
sox-14.4.0 2012-03-04
--- a/README.osx
+++ b/README.osx
@@ -73,15 +73,16 @@
MAD MP3 decoder http://www.underbit.com/products/mad
If your system is setup to compile software, then the following commands
-can be used:
+can be used. Note: since SoX is distributed as a 32-bit i386 binary,
+the library must match that format as well:
cd lame-398-2
-./configure
+./configure CFLAGS="-arch i386 -m32" LDFALGS="-arch i386"
make
sudo make install
cd libmad-0.15.1b
-./configure
+./configure CFLAGS="-arch i386 -m32" LDFALGS="-arch i386"
make
sudo make install
@@ -105,7 +106,7 @@
http://sourceforge.net/projects/opencore-amr
cd opencore-amr-0.1.2
-./configure
+./configure CFLAGS="-arch i386 -m32" LDFALGS="-arch i386"
make
sudo make install
--- a/configure.ac
+++ b/configure.ac
@@ -12,7 +12,7 @@
AM_INIT_AUTOMAKE
dnl create a config.h file (Automake will add -DHAVE_CONFIG_H)
-AM_CONFIG_HEADER(src/soxconfig.h)
+AC_CONFIG_HEADERS([src/soxconfig.h])
dnl Check we have the right srcdir
AC_CONFIG_SRCDIR(sox.1)
--- a/mingwbuild
+++ b/mingwbuild
@@ -29,24 +29,23 @@
# The following command lines were used to generate the static external
# libraries SoX ships with.
#
-# cd libtool-2.2.6b
+# cd libtool-2.4.2
# mingw32-configure --disable-shared --enable-static;mingw32-make;sudo mingw32-make install
#
# libpng.la will have libtool issue because depends on libz
# which has a libz.la file. Must edit libpng.la to
# prevent needing to distribute zlib1.dll.
-# cd libpng-1.2.41
+# cd libpng-1.5.7
# mingw32-configure --disable-shared --enable-static;mingw32-make;sudo mingw32-make install
#
-# MINGW work around: had to comment out "cli" from SUBDIR.
# cd ../wavpack-4.60.1
# mingw32-configure --disable-shared --enable-static;mingw32-make;sudo mingw32-make install
#
-# MINGW fixes for FLAC: Needed to edit include/share/alloc.h and remove
-# !defined __MINGW32__ check so that stdint.h is included.
+# Need to disable optional ogg support to prevent duplicate symbols during
+# link.
# Edited Makefile and removed "examples" from SUBDIRS.
# cd ../flac-1.2.1
-# mingw32-configure --disable-shared --enable-static;mingw32-make;sudo mingw32-make install
+# mingw32-configure --disable-ogg --disable-shared --enable-static;mingw32-make;sudo mingw32-make install
#
# cd ../libogg-1.3.0
# mingw32-configure --disable-shared --enable-static;mingw32-make;sudo mingw32-make install
@@ -86,15 +85,15 @@
STRIP=strip
;;
*)
- SYS_ROOT="/usr/i686-pc-mingw32/sys-root"
+ SYS_ROOT="/usr/i686-w64-mingw32/sys-root"
CONFIGURE=mingw32-configure
DOC_TARGETS="pdf"
DOCS="sox.pdf soxformat.pdf soxi.pdf"
- TMP_SNDFILE_LIBS="-lsndfile -lFLAC -lwsock32 -lvorbisenc -lvorbisfile -lvorbis -logg"
+ TMP_SNDFILE_LIBS="-lsndfile -lFLAC -lvorbisenc -lvorbisfile -lvorbis -logg"
# TODO: libFLAC is referencing ntohl() but not defining it in their
# flac.pc. Its not obvious how upstream is going to fix this issue
# so work around in script for now.
- TMP_FLAC_LIBS="-lwsock32"
+ #TMP_FLAC_LIBS="-lwsock32"
STRIP=i686-pc-mingw32-strip
esac
--- a/osxbuild
+++ b/osxbuild
@@ -4,11 +4,11 @@
# package of SoX.
#
# It requires to already have several external libraries already installed
-# under /usr/local. The external libraries must be static only or else
+# under /usr/local/10.5. The external libraries must be static only or else
# it will expect dylib versions to already exist on external boxes.
#
-# This goes out of its way to only compile i386 binary and to use
-# OS X 10.5 SDK for greater compatibilty.
+# This goes out of its way to only compile a 32 bit i386 binary and to use the
+# oldest available SDK for greater compatibility.
#
# Various notes:
#
@@ -16,37 +16,50 @@
# libraries SoX ships with.
#
# cd libtool-2.4.2
-#./configure CFLAGS="-m32 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" LDFLAGS="-arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" --disable-shared --enable-static;make;sudo make install
+# ./configure --prefix=/usr/local/10.5 CFLAGS="-m32 -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.5" LDFLAGS="-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.5" --disable-shared --enable-static;make;sudo make install
#
# cd libpng-1.5.7
-#./configure CFLAGS="-m32 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" LDFLAGS="-arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" --disable-shared --enable-static;make;sudo make install
+# ./configure --prefix=/usr/local/10.5 CFLAGS="-m32 -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.5" LDFLAGS="-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.5" --disable-shared --enable-static;make;sudo make install
#
# cd ../wavpack-4.60.1
-#./configure CFLAGS="-m32 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" LDFLAGS="-arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" --disable-shared --enable-static;make;sudo make install
+# ./configure --prefix=/usr/local/10.5 CFLAGS="-m32 -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.5" LDFLAGS="-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.5" --disable-shared --enable-static;make;sudo make install
#
# flac won't compile without following fix. Edit src/libFLAC/ia32/nasm.h and
# add following to top of that file: %define FLAC__PUBLIC_NEEDS_UNDERSCORE
# cd ../flac-1.2.1
-#./configure CXXFLAGS="-m32 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" CFLAGS="-m32 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" LDFLAGS="-arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" --disable-shared --enable-static;make;sudo make install
+# ./configure --prefix=/usr/local/10.5 CFLAGS="-m32 -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.5" CXXFLAGS="-m32 -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.5" LDFLAGS="-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.5" --disable-shared --enable-static;make;sudo make install
#
# cd ../libogg-1.3.0
-#./configure CFLAGS="-m32 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" LDFLAGS="-arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" --disable-shared --enable-static;make;sudo make install
+# ./configure --prefix=/usr/local/10.5 CFLAGS="-m32 -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.5" LDFLAGS="-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.5" --disable-shared --enable-static;make;sudo make install
#
# cd ../libvorbis-1.3.2
-#./configure CPPFLAGS="-I/usr/local/include" CFLAGS="-m32 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" LDFLAGS="-arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" --disable-shared --enable-static;make;sudo make install
+# ./configure --prefix=/usr/local/10.5 CFLAGS="-m32 -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.5" LDFLAGS="-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.5" --disable-shared --enable-static;make;sudo make install
#
+# When compiling with newer versions of OS X, Carbon.h does not exist and
+# doesn't need to be included by app. Edit programs/sndfile-play.c and
+# delete/comment out line 61.
# cd ../libsndfile-1.0.25
-#./configure CXXFLAGS="-m32 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" CFLAGS="-m32 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" LDFLAGS="-arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" --disable-shared --enable-static;make;sudo make install
+# ./configure --disable-sqlite --prefix=/usr/local/10.5 CFLAGS="-m32 -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.5" CXXFLAGS="-m32 -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.5" LDFLAGS="-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.5" --disable-shared --enable-static;make;sudo make install
#
# cd ../libid3tag-0.15.1b
-#./configure CXXFLAGS="-m32 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" CFLAGS="-m32 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" LDFLAGS="-arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" --enable-static --disable-shared;make;sudo make install
+# ./configure --prefix=/usr/local/10.5 CFLAGS="-m32 -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.5" LDFLAGS="-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.5" --disable-shared --enable-static;make;sudo make install
#
# To get MP3 header files used to enable MP3 support (no libraries used):
#
+# brew install mad
+#
+# or compile and install:
+#
# cd ../libmad-0.15.1b
#./configure CFLAGS="-m32 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" LDFLAGS="-arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" --enable-shared --disable-static;make;sudo make install
#
+if [ -d /Developer/SDKs/MacOSX10.5.sdk ]; then
+ MacOSXSDK=/Developer/SDKs/MacOSX10.5.sdk
+else
+ MacOSXSDK=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk
+fi
+
[ ! -x configure ] && autoreconf -i
# Some versions of autoconf (2.63?) seem to get easily confused about
@@ -60,9 +73,9 @@
--enable-dl-lame --enable-dl-mad \
--enable-dl-amrnb --enable-dl-amrwb \
CPP=cpp\
- CPPFLAGS="-I/usr/local/include" \
- CFLAGS="-m32 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" \
- LDFLAGS="-L/usr/local/lib -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" \
+ CPPFLAGS="-I/usr/local/10.5/include -I/usr/local/include" \
+ CFLAGS="-m32 -arch i386 -isysroot ${MacOSXSDK} -mmacosx-version-min=10.5" \
+ LDFLAGS="-L/usr/local/10.5/lib -m32 -arch i386 -isysroot ${MacOSXSDK} -mmacosx-version-min=10.5" \
$*
fi
--- a/sox.1
+++ b/sox.1
@@ -874,9 +874,9 @@
If SoX has been built with the optional `libmagic' library then this
option can be given to enable its use in helping to detect audio file types.
.TP
-\fB\-\-multi-threaded\fR | \fB\-\-single-threaded\fR
+\fB\-\-multi\-threaded\fR | \fB\-\-single\-threaded\fR
By default, SoX is `single threaded'.
-If the \fB\-\-multi-threaded\fR option is given however then SoX
+If the \fB\-\-multi\-threaded\fR option is given however then SoX
will process audio channels for most multi-channel
effects in parallel on hyper-threading/multi-core architectures. This
may reduce processing time, though sometimes it may be necessary to use
@@ -1064,7 +1064,7 @@
These options apply only to input files and may precede only input
filenames on the command line.
.TP
-\fB\-\-ignore-length\fR
+\fB\-\-ignore\-length\fR
Override an (incorrect) audio length given in an audio file's header. If
this option is given then SoX will keep reading audio until it reaches
the end of the input file.
@@ -1235,7 +1235,7 @@
performed by SoX on the following filename. For example, if the current
directory contains the two files `five-seconds.wav' and `five*.wav', then
.EX
- play \-\-no-glob "five*.wav"
+ play \-\-no\-glob "five*.wav"
.EE
can be used to play just the single file `five*.wav'.
.TP
@@ -3158,7 +3158,7 @@
.RS
.IP \fB\-x\ \fInum\fR
Change the (maximum) width (X-axis) of the spectrogram from its default
-value of 800 pixels to a given number between 100 and 5000.
+value of 800 pixels to a given number between 100 and 200000.
See also \fB\-X\fR and \fB\-d\fR.
.IP \fB\-X\ \fInum\fR
X-axis pixels/second; the default is auto-calculated to fit the given
--- a/src/flac.c
+++ b/src/flac.c
@@ -415,7 +415,6 @@
lsx_fail_errno(ft, SOX_ENOMEM, "FLAC ERROR creating the encoder instance");
return SOX_EOF;
}
- p->decoded_samples = lsx_malloc(sox_globals.bufsiz * sizeof(FLAC__int32));
p->bits_per_sample = ft->encoding.bits_per_sample;
ft->signal.precision = ft->encoding.bits_per_sample;
@@ -535,6 +534,13 @@
{
priv_t * p = (priv_t *)ft->priv;
unsigned i;
+
+ /* allocate or grow buffer */
+ if (p->number_of_samples < len) {
+ p->number_of_samples = len;
+ free(p->decoded_samples);
+ p->decoded_samples = lsx_malloc(p->number_of_samples * sizeof(FLAC__int32));
+ }
for (i = 0; i < len; ++i) {
SOX_SAMPLE_LOCALS;
--- a/src/rate.c
+++ b/src/rate.c
@@ -479,10 +479,11 @@
{
fifo_t * fifo = &p->stages[p->num_stages].fifo;
uint64_t samples_out = p->samples_in / p->factor + .5;
- size_t remaining = samples_out - p->samples_out;
+ size_t remaining = samples_out > p->samples_out ?
+ (size_t)(samples_out - p->samples_out) : 0;
sample_t * buff = calloc(1024, sizeof(*buff));
- if (samples_out > p->samples_out) {
+ if (remaining > 0) {
while ((size_t)fifo_occupancy(fifo) < remaining) {
rate_input(p, buff, (size_t) 1024);
rate_process(p);
--- a/src/sox.c
+++ b/src/sox.c
@@ -2743,7 +2743,7 @@
"-s\tShow number of samples (0 if unavailable)\n"
"-d\tShow duration in hours, minutes and seconds (0 if unavailable)\n"
"-D\tShow duration in seconds (0 if unavailable)\n"
- "-b\tShow number of bits per sample\n"
+ "-b\tShow number of bits per sample (0 if not applicable)\n"
"-B\tShow the bitrate averaged over the whole file (0 if unavailable)\n"
"-p\tShow estimated sample precision in bits\n"
"-e\tShow the name of the audio encoding\n"
--- a/src/soxconfig.h.cmake
+++ b/src/soxconfig.h.cmake
@@ -47,6 +47,7 @@
#cmakedefine HAVE_SUN_AUDIOIO_H 1
#cmakedefine HAVE_SYS_AUDIOIO_H 1
#cmakedefine HAVE_SYS_SOUNDCARD_H 1
+#cmakedefine HAVE_SYS_STAT_H 1
#cmakedefine HAVE_SYS_TIMEB_H 1
#cmakedefine HAVE_SYS_TIME_H 1
#cmakedefine HAVE_SYS_TYPES_H 1
--- a/src/spectrogram.c
+++ b/src/spectrogram.c
@@ -33,6 +33,8 @@
#define MAX_FFT_SIZE 4096
#define is_p2(x) !(x & (x - 1))
+#define MAX_X_SIZE 200000
+
typedef enum {Window_Hann, Window_Hamming, Window_Bartlett, Window_Rectangular, Window_Kaiser} win_type_t;
static lsx_enum_item const window_options[] = {
LSX_ENUM_ITEM(Window_,Hann)
@@ -104,7 +106,7 @@
p->out_name = "spectrogram.png", p->comment = "Created by SoX";
while ((c = lsx_getopt(&optstate)) != -1) switch (c) {
- GETOPT_NUMERIC(optstate, 'x', x_size0 , 100, 5000)
+ GETOPT_NUMERIC(optstate, 'x', x_size0 , 100, MAX_X_SIZE)
GETOPT_NUMERIC(optstate, 'X', pixels_per_sec, 1 , 5000)
GETOPT_NUMERIC(optstate, 'y', y_size , 64 , 1200)
GETOPT_NUMERIC(optstate, 'Y', Y_size , 130, MAX_FFT_SIZE / 2 + 2)
@@ -224,7 +226,7 @@
if (!pixels_per_sec && p->x_size && duration)
pixels_per_sec = min(5000, p->x_size / duration);
else if (!p->x_size && pixels_per_sec && duration)
- p->x_size = min(5000, (int)(pixels_per_sec * duration + .5));
+ p->x_size = min(MAX_X_SIZE, (int)(pixels_per_sec * duration + .5));
if (!duration && effp->in_signal.length != SOX_UNKNOWN_LEN) {
duration = effp->in_signal.length / (effp->in_signal.rate * effp->in_signal.channels);
duration -= start_time;
--- a/src/splice.c
+++ b/src/splice.c
@@ -179,6 +179,7 @@
p->buffer = lsx_calloc(p->max_buffer_size * effp->in_signal.channels, sizeof(*p->buffer));
p->in_pos = p->buffer_pos = p->splices_pos = 0;
p->state = p->splices_pos != p->nsplices && p->in_pos == p->splices[p->splices_pos].start;
+ effp->out_signal.length = SOX_UNKNOWN_LEN; /* depends on input data */
for (i = 0; i < p->nsplices; ++i)
if (p->splices[i].overlap) {
if (p->fade_type == Cosine_4 && effp->in_signal.mult)
@@ -185,7 +186,6 @@
*effp->in_signal.mult *= pow(.5, .5);
return SOX_SUCCESS;
}
- effp->out_signal.length = SOX_UNKNOWN_LEN; /* depends on input data */
return SOX_EFF_NULL;
}
--- a/src/tempo.c
+++ b/src/tempo.c
@@ -38,10 +38,10 @@
fifo_t output_fifo;
/* Counters: */
- size_t samples_in;
- size_t samples_out;
- size_t segments_total;
- size_t skip_total;
+ uint64_t samples_in;
+ uint64_t samples_out;
+ uint64_t segments_total;
+ uint64_t skip_total;
} tempo_t;
/* Waveform Similarity by least squares; works across multi-channels */
@@ -147,11 +147,12 @@
/* Flush samples remaining in overlap_buf & input_fifo to the output. */
static void tempo_flush(tempo_t * t)
{
- size_t samples_out = t->samples_in / t->factor + .5;
- size_t remaining = samples_out - t->samples_out;
+ uint64_t samples_out = t->samples_in / t->factor + .5;
+ size_t remaining = samples_out > t->samples_out ?
+ (size_t)(samples_out - t->samples_out) : 0;
float * buff = lsx_calloc(128 * t->channels, sizeof(*buff));
- if ((int)remaining > 0) {
+ if (remaining > 0) {
while (fifo_occupancy(&t->output_fifo) < remaining) {
tempo_input(t, buff, (size_t) 128);
tempo_process(t);
--- a/src/wav.c
+++ b/src/wav.c
@@ -623,7 +623,7 @@
wav->packet = NULL;
wav->samples = NULL;
- /* non-PCM formats expect alaw and mulaw formats have extended fmt chunk.
+ /* non-PCM formats except alaw and mulaw formats have extended fmt chunk.
* Check for those cases.
*/
if (wav->formatTag != WAVE_FORMAT_PCM &&
@@ -633,7 +633,7 @@
lsx_readw(ft, &wExtSize);
len -= 2;
} else {
- lsx_warn("wave header missing FmtExt chunk");
+ lsx_warn("wave header missing extended part of fmt chunk");
}
}
@@ -780,6 +780,11 @@
case 2: case 3: case 4:
if (ft->encoding.encoding == SOX_ENCODING_UNKNOWN)
ft->encoding.encoding = SOX_ENCODING_SIGN2;
+ break;
+
+ case 8:
+ if (ft->encoding.encoding == SOX_ENCODING_UNKNOWN)
+ ft->encoding.encoding = SOX_ENCODING_FLOAT;
break;
default: