Commit Graph

2545 Commits

Author SHA1 Message Date
IOhannes m zmölnig
f9a3fab6aa examples/sndfile-to-text: added '--full-precision' flag
Specifying this flag will store the samples in full precision
(so they can be losslessly restored from the text-file).

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
Closes: https://github.com/erikd/libsndfile/pull/186
2016-10-13 19:44:46 +11:00
Erik de Castro Lopo
2c4ebd959f Further improvements to create_symbols_file 2016-10-13 18:58:24 +11:00
Erik de Castro Lopo
c59d99b06f src/Makefile.am: Add dependencies for Symbols files 2016-10-12 21:21:30 +11:00
Erik de Castro Lopo
ae272b59c0 Reimplement create_symbols_file in C
Apparently the need for Python makes libsndfile difficult to build
on Windows, so re-implement this program in C.
2016-10-11 19:46:51 +11:00
Erik de Castro Lopo
2fcf531ac9 src/alac.c: Remove large stack allocations
When compiled with MSVC, this code would fail because the
`byte_buffer` arrays on the stack were too large. Put them in
the heap allocated `ALAC_PRIVATE` struct instead.

Closes: https://github.com/erikd/libsndfile/issues/164
2016-09-14 18:00:13 +10:00
Erik de Castro Lopo
b5bc6631f8 src/aiff.c: Fix compiler warning
Don't try to shift a 32 bit value by more than 32 bits.
2016-09-12 19:40:03 +10:00
evpobr
2f699cf96c sndfile.h: Select MSVC version when defining SF_COUNT_MAX
Later versions of MSVC have bothing `long long` and the `LL`
specifier.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
Closes: https://github.com/erikd/libsndfile/issues/155
2016-09-12 17:21:14 +10:00
Erik de Castro Lopo
a547d06726 Revert "configure.ac: Fix out-of-tree builds"
This reverts commit 1015973005
because that commit messes up 'make distcheck'.
2016-09-11 09:02:27 +10:00
Erik de Castro Lopo
1015973005 configure.ac: Fix out-of-tree builds
The link stage was looking for the Symbol.* files in the source
tree rather than the build tree.
2016-09-11 08:23:40 +10:00
Erik de Castro Lopo
08dfe89c61 tests: Remove need for POSIX truncate function
Windows doesn't have `truncate` and since it was only being used
to truncate the file to zero length, implement a cross platform
`truncate_file_to_zero`.

Based on an idea from <evpobr@gmail.com>.
2016-09-09 19:15:42 +10:00
evpobr
cd0332c026 Use INT64_C macro if available
If stdint.h header is available, use standard INT64_C macro to
declare 64-bit integer constants.

This makes code more portable.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
Closes: https://github.com/erikd/libsndfile/pull/148
2016-09-09 19:01:52 +10:00
Erik de Castro Lopo
cf30d2d529 Don't force 'unsigned char'
The configure script had been forcing `-funsigned-char` which is not
supported by some compilers like Sun Studio.

Fixup one test which was failing on Sun Studio due to differences in
how that compiler handles undefined behaviour around assigning an
unsigned char value to a signed char.
2016-09-06 18:19:46 +10:00
evpobr
9705236451 Add .gitattributes file
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
Closes: https://github.com/erikd/libsndfile/pull/144
2016-09-06 18:17:43 +10:00
evpobr
fdf75785dc configure.ac: Better checking for ssize_t
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
Closes: https://github.com/erikd/libsndfile/pull/142
2016-09-03 20:39:29 +10:00
Erik de Castro Lopo
d576914d8d configure.ac: Add -Wvla to CFLAGS
Want to warn about usage of Variable Length Arrays so they aren't
added by mistake.
2016-09-03 18:12:19 +10:00
Erik de Castro Lopo
ba352a1ce7 Remove all use of Variable Length Arrays
VLAs are somewhat unsound and are being made an optional part of ISO
C specification.
2016-09-03 18:11:56 +10:00
Erik de Castro Lopo
f405bdab07 src/aiff.c: Refactoring
Main aim was to reduce the usage of Variable Length Arrays (VLAs) which
were being use to write Pascal strings to the AIFF header. Since
`psf_binheader_writef` now supports writing Pascal strings we can avoid
VLAs.
2016-09-03 11:47:33 +10:00
Erik de Castro Lopo
86d9fb853d psf_binheader_writef: Add writing of Pascal strings
AIFF headers can contain Pascal style strings which consist of a
single byte length (which limits them the 255 bytes) followed by
the string. The total is zero padded to an even number of bytes.
Tests included.
2016-09-03 11:40:08 +10:00
evpobr
60710409b0 configure.ac: Two minor fixes
* Replace obsolete AM_PROG_LIBTOOL with LT_INIT.
* Remove useless define AC_LIBTOOL_LANG_F77_CONFIG.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
Closes: https://github.com/erikd/libsndfile/pull/141
2016-09-03 07:46:42 +10:00
Erik de Castro Lopo
de4e99c325 src/GSM610/lpc.c: Fixup
Commit 8d9cd93f26 fixed compiler warnings but changed a correct
for loop into an in-correct `memset` operation. This commit fixes
it.
2016-08-14 17:07:50 +10:00
Erik de Castro Lopo
8d9cd93f26 Fix compiler warnings from gcc 6.1.1 2016-08-13 12:10:40 +10:00
Erik de Castro Lopo
0ec474be9a README.md: Add libasound to the list of build deps 2016-07-28 21:15:59 +10:00
Erik de Castro Lopo
77691aa793 README.md: Another fix
For Debian/Ubuntu, fix build-essential and add python.
2016-07-27 06:25:42 +10:00
Erik de Castro Lopo
4640558527 README.md: Improve explanation of building from git 2016-07-26 19:24:37 +10:00
Erik de Castro Lopo
b3f677616e Fix spelling errors
* Two in error messages in library itself.
* One in man page for sndfile-interleave.
2016-07-20 20:05:38 +10:00
Erik de Castro Lopo
207b926557 Add file Building-for-Android.md
And link to it from README.md.
2016-07-16 22:07:41 +10:00
Erik de Castro Lopo
e8afbc370e Scripts/android-configure.sh: Minor updates
* Error out if ${ANDROID_TOOLCHAIN_HOME} is not set.
* Use default values for ${ANDROID_NDK_VER}, ${ANDROID_GCC_VER},
  ${ANDROID_API_VER} and ${ANDROID_TARGET} so they can be overridden.
2016-07-16 19:34:58 +10:00
Erik de Castro Lopo
0546fa2503 libsndfile.cmake: Set __USE_MINGW_ANSI_STDIO as needed 2016-07-07 19:53:00 +10:00
Erik de Castro Lopo
33f04ef71c Scripts/git-pre-commit-hook: Support GNU and BSD sed 2016-07-07 19:35:11 +10:00
Erik de Castro Lopo
818824d340 Delete Scripts/static-deps-build.mk
This never worked as intended and probably can't be fixed.
2016-07-03 19:35:04 +10:00
Erik de Castro Lopo
05288ca11e Revert "Drop use of __USE_MINGW_ANSI_STDIO"
This reverts commit ac0c02de3c.

This define is needed when cross compiling from Linux to Windows.
2016-07-03 19:02:03 +10:00
Erik de Castro Lopo
7b6d2f85b0 CMake: More fixes 2016-07-03 14:14:17 +10:00
Erik de Castro Lopo
7774043243 ALAC: Fix warnings from AppleClang 2016-07-03 11:34:29 +10:00
Erik de Castro Lopo
ac0c02de3c Drop use of __USE_MINGW_ANSI_STDIO 2016-07-03 11:05:08 +10:00
Erik de Castro Lopo
50a4098e9f sndfile-play: Remove support for Darwin <= 11
Darwin 12 (Mountain Lion) was released in February 2012. Apple no
longer support 11 and neither does libsndfile.
2016-07-03 10:33:31 +10:00
Erik de Castro Lopo
ec7d3cfab8 README.md: Typo 2016-07-03 08:23:06 +10:00
Erik de Castro Lopo
cb47664a80 CMake/file.cmake: Handle leading space from wc output 2016-07-03 08:21:22 +10:00
Erik de Castro Lopo
6776ceafa8 CMake: Detect and link external libs (FLAC/vorbis/ogg)
Works on Linux, not tested elsewhere.
2016-07-02 21:16:40 +10:00
Erik de Castro Lopo
5f639642bf README.md: Minimal documentation for the CMake build system 2016-07-02 17:25:15 +10:00
Erik de Castro Lopo
f59bab6215 Makefile.am: Add CMake files to EXTRA_DIST 2016-07-02 17:25:15 +10:00
Erik de Castro Lopo
9c6e45a103 Comprehensive CMake improvements
It should now be possible to build libsndfile from a git checkout, at
least on Linux. No idea if it will work on other systems.

Additionally, if one builds on linux from a git checkout and then builds
a distribution tarball, it should be possible to transfer that distribution
tarball to a system without the GNU autotools and build it using CMake. This
however has not been tested.
2016-07-02 17:15:47 +10:00
Erik de Castro Lopo
145e2b8f4a src/alac.c: Fix VLA size in alac_close()
The type of `kuki_data` was `uint8_t *` instead of `uint8_t`. For
some reason the C type checker was not able to pick this up.

Closes:  https://github.com/erikd/libsndfile/issues/135
2016-06-25 08:48:32 +10:00
Erik de Castro Lopo
5afbcc6cf4 configure.ac: 1.0.28pre1 2016-06-19 21:39:20 +10:00
Erik de Castro Lopo
d3d545abf9 Version 1.0.27 2016-06-19 18:08:54 +10:00
Erik de Castro Lopo
951718c4cd src/paf.c: Fix alignment issues compiling for Arm
Fix an issue introduced in commit a1f41d90bf.

Earlier versions of Arm (before armv7) did not handle un-aligned
accesses so that GCC warns about casts that increase alignment
requirements (like casts from `char*` to `int*`). Fix this by changing
the pointer from `char*` to `int*` and casting back to `char*` as needed
instead of doing the reverse.
2016-05-23 20:41:23 +10:00
Erik de Castro Lopo
a1f41d90bf src/paf.c: Fix a long standing endian issue
There has been a long standing issue where something was not quite
right with the endian-ness handle of PAF files. This was difficlt to
track down because of the difficulty in getting access to a Paris Audio
system. Fortunately, Jeremy Friesner <jfriesne@gmail.com> was able to
provide some test files and a preliminary patch.
2016-05-22 19:57:09 +10:00
RiCON
5cc981dfc4 sndfile.pc.in: missing update from 95828ca2
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2016-04-30 07:29:07 +10:00
Erik de Castro Lopo
afcf447499 src/wavlike.c: Prevent infinite loop on malformed file
Found using American Fuzzy Lop.
2016-04-24 08:02:11 +10:00
Erik de Castro Lopo
7b7e0d913b SF_CUES: Fix for big-endian CPUs 2016-04-15 22:27:08 +10:00
Erik de Castro Lopo
1f1b9de462 SF_CUES: Work around Clang mis-feature
For some reason Clang refuses to calculate `sizeof (SF_CUES_VAR (1))`
so we have to manually bodgy our way around this.
2016-04-15 21:26:10 +10:00