Commit Graph

2333 Commits

Author SHA1 Message Date
Erik de Castro Lopo
cb0abd8573 CMake/build.cmake : Fix for CMake 3.0.2.
Previous versions of CMake allowed targets names like "tests/win32_test"
but CMake 3.0.2 doesn't. The corresponding target name for the new CMake
is "win32_test", but putting the resulting executable in the tests/
directory requires something like:

    add_executable (win32_test tests/win32_test.c)
    set_target_properties (win32_test
                           PROPERTIES RUNTIME_OUTPUT_DIRECTORY tests)
2014-11-02 13:23:15 -08:00
Erik de Castro Lopo
1d0ff7edd4 src/sndfile.c : Return an error if the file path is too long. 2014-10-29 20:56:12 -07:00
Erik de Castro Lopo
7da769461c src/common.h : Double value of SF_FILENAME_LEN to 1024.
Closes: https://github.com/erikd/libsndfile/issues/81
2014-10-29 20:53:52 -07:00
Erik de Castro Lopo
334ac776f5 Minor CMake files.
* CMake now fails of CMake/config.h.in doesn't exist.
* Command './autogen cmake' now generates CMake/config.h.in.
2014-10-28 21:00:08 +11:00
Erik de Castro Lopo
448e9ec8e7 src/flac.c : Remove un-needed code.
The code was calling FLAC__stream_decoder_seek_absolute () immediately
followed by a call to FLAC__stream_decoder_get_decode_position (), the
result of which was immediately thrown away.

Reported-by: Mario Lang <mlang@delysid.org>
2014-10-27 20:52:08 +11:00
Mario Lang
e873283dc3 Fix some typos.
Closes: https://github.com/erikd/libsndfile/pull/79
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2014-10-27 06:17:57 +11:00
Erik de Castro Lopo
19e12f5641 src/sndfile.c : Fix sfinfo.frames file on SFM_WRITE.
When opening a file in SFM_WRITE mode where the output is a pipe,
the sfinfo.frames value was coming back with strange values. The
fix is simply to make sure it get set to zero.

Closes: https://github.com/erikd/libsndfile/issues/77
2014-10-17 21:25:36 +11:00
Erik de Castro Lopo
bc012ab732 src/common.h : Increase SF_MAX_CHANNELS from 256 to 1024.
Closes: https://github.com/erikd/libsndfile/issues/78
2014-10-12 09:35:16 +11:00
Erik de Castro Lopo
b5e61032bf src/ : Add more checks for suported channel counts. 2014-10-08 13:01:11 +11:00
Erik de Castro Lopo
94746e359c AUTHORS : Add contributors. 2014-09-02 06:17:37 +10:00
Timothy Gu
9c2575f7de configure.ac: Fix detection of MinGW
This is more consistent with other checks in the file and fixes #75.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2014-09-02 06:16:16 +10:00
Erik de Castro Lopo
c1cc8db319 Purge redundant file binheader_readf_check.py. 2014-08-12 20:30:08 +10:00
Erik de Castro Lopo
8327dd3070 CMakeLists.txt : Use bash to run test_wrapper.sh. 2014-08-12 20:10:32 +10:00
Erik de Castro Lopo
6ac898c7b6 More fixes for HAVE_SNDIO_H changes. 2014-08-03 19:54:45 +10:00
Erik de Castro Lopo
548cd98a0d configure.ac : Fix chmod of Scripts/build-test-tarball.mk. 2014-08-03 19:54:11 +10:00
Erik de Castro Lopo
d7dd4d035f CMakeLists.txt : Generate tests/test_wrapper.sh during configure.
Plus other minor cleanups.
2014-07-31 22:08:01 +10:00
Erik de Castro Lopo
56ee678e7d CMake : Build system nears parity with autotool build system.
Specifically, it can now build the shared library (without Ogg/Vorbis
or FLAC support) and the programs as well as building and running
the tests using 'make check'. This new CMake build system has a single
top level build description and on Unix, by default generates a non-
recursive Makefile (unlike the existing autotools build system).

I dedicate this commit to Peter Miller (pmiller) who died in the early
hours of 2014/07/27 after a long illness. Peter was the author of the
paper "Recursive Make Considered Harmful":

    http://aegis.sourceforge.net/auug97.pdf

This paper was the inspiration for the build systems for the Linux
kernel, the Glasgow Haskell Compiler and many other projects.

Peter was also the author of a Make replacement program Cook:

    http://miller.emu.id.au/pmiller/software/cook/

Peter was a great friend, a great work colleague and an extremely
skilled and knowledgeable software engineer.

Goodbye my friend. #commitforpmiller
2014-07-31 21:18:30 +10:00
Erik de Castro Lopo
96ebac2d2e Update .gitignore for CMake artifacts. 2014-07-31 12:07:45 +10:00
Erik de Castro Lopo
40736c98b4 tests/ : Fix warnings from clang 3.5. 2014-07-31 08:57:49 +10:00
Erik de Castro Lopo
c161588249 Fix detection and usage OpenBSD's <sndio.h>. 2014-07-30 14:36:47 +10:00
Tristan Matthews
e3cce28812 src/sndfile.hh: initialize all member variables
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2014-07-17 06:35:20 +10:00
Erik de Castro Lopo
e2d39c7b69 CMake : Detect functions and libraries. 2014-07-13 12:48:02 +10:00
Erik de Castro Lopo
e693055680 CMakeLists.txt : Build a versioned shared library. 2014-07-13 12:21:06 +10:00
Erik de Castro Lopo
3afc448137 CMake : Add all the library C files and start on CFLAGS. 2014-07-13 02:46:34 +10:00
Erik de Castro Lopo
9ee3216fb1 CMake : Split functions out into a separate file. 2014-07-13 01:55:13 +10:00
Erik de Castro Lopo
0775675d17 CMake : Use check_type_size as needed. 2014-07-12 23:46:12 +10:00
Erik de Castro Lopo
bfd1320d9c CMake : Detect and set COMPILER_IS_GCC. 2014-07-12 23:18:11 +10:00
Erik de Castro Lopo
8971af22d0 autogen.sh : Generate CMake/config.h.in from src/config.h.in. 2014-07-12 21:19:52 +10:00
Erik de Castro Lopo
adec6a7c61 CMakeLists.txt : First pass at making it work for Linux.
Cmake is great for really simple stuff but is at least as difficult
as autotools for more complicated stuff.
2014-07-12 21:19:52 +10:00
Erik de Castro Lopo
3d01b6c067 Add CMakeLists.txt.
Initial start to this stolen from:

    https://github.com/johnwbyrd/libsndfile-cmake
2014-07-12 21:07:07 +10:00
Erik de Castro Lopo
6ff4d03b40 src/common.h : Unifiy usage of COMPILER_IS_GCC. 2014-07-12 21:06:51 +10:00
Erik de Castro Lopo
6351b58776 Update .gitignore. 2014-07-12 21:06:51 +10:00
Erik de Castro Lopo
2567b6345b src/test_endswap.def : Enclose hex literals in single quotes. 2014-07-12 10:34:15 +10:00
Erik de Castro Lopo
4e6c87b38c src/wav.c : Fix length of 'data' section.
The WAV file 'data' chunk should always be an even number of bytes in
length. To ensure this we add a padding byte as needed. On read we
check the 'data' chunk length and write a warning to the internal log
file if the 'data' chunk is not an even number of bytes in length.

Closes: https://github.com/erikd/libsndfile/issues/61
2014-07-11 20:44:24 +10:00
Erik de Castro Lopo
96a8eb0485 src/wav.c : Ensure all non-PCM files contain a 'fact' chunk.
According to:

    http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html

all non-PCM formats must have a 'fact' chunk. This commit does two things:

* Add code to write a warning to the internal log file on file read/open if
  there is no 'fact' chunks.
* Add a 'fact' chunk on write as needed.

See: https://github.com/erikd/libsndfile/issues/70
2014-07-11 20:37:08 +10:00
Erik de Castro Lopo
4a6ed636bf tests/floating_point_test.tpl : Adjust SNR targets for OpenBSD.
It seems that the gcc-4.2.1 compiler being used in OpenBSD handles floating
point values differently than the same compiler on other operating systems
and that causes the SNR targets not be be met.
2014-07-04 20:36:31 +10:00
Erik de Castro Lopo
c66bb23bfb configure.ac : Detect OpenBSD as a separate OS. 2014-07-04 20:35:31 +10:00
Erik de Castro Lopo
b25f7f3bb3 Revert "src/sndfile.c : Make WAV/GSM610 with sample rates other than 8kHz invalid."
Commit was a0be1713b5.

Also revert the related commits:
* e4253e1609
* 77504d6abd
2014-07-03 21:30:52 +10:00
Erik de Castro Lopo
77504d6abd programs/sndfile-convert.c : Improve error message for GSM610.
Suggested-by: Jan Stary <hans@stare.cz>
2014-07-02 19:47:37 +10:00
Erik de Castro Lopo
e4253e1609 tests/ : Fix tests for SF_FORMAT_GSM610.
Commit a0be1713 only allows SF_FORMAT_GSM610 to be used with a sample
rate of 8Khz. Adjust tests to use sample rate of 8000 whenever the
sub-format isf GSM610.
2014-07-02 19:43:37 +10:00
Erik de Castro Lopo
a0be1713b5 src/sndfile.c : Make WAV/GSM610 with sample rates other than 8kHz invalid.
GSM 6.10 is only valid for 8kHz sample rate. See:

    https://en.wikipedia.org/wiki/Full_Rate

Patch-from: Jan Stary <hans@stare.cz>
2014-07-02 19:21:23 +10:00
Erik de Castro Lopo
06eef439db man/Makefile.am : Hook up sndfile-salvage.1.
Patch-from: Jan Stary <hans@stare.cz>
2014-07-02 06:42:32 +10:00
Erik de Castro Lopo
f74ceb191a man/sndfile-(convert|salvage).1 : Typos.
Patch-from: Jan Stary <hans@stare.cz>
2014-07-02 06:41:38 +10:00
Erik de Castro Lopo
e90b2de900 doc/api.html : Fix typos.
Patch-from: Jan Stary <hans@stare.cz>
2014-07-02 06:33:09 +10:00
Erik de Castro Lopo
bbd4512540 programs/sndfile-convert.c : Add warning for some conversions.
Specifically when converting to GSM 6.10 when the input samplerate
is not 8kHz no resampling will be done so when the file is played
it will simply sound like the original input file played at the
new sample rate.

Suggested-by: Jan Stary <hans@stare.cz>
2014-07-01 21:30:12 +10:00
Erik de Castro Lopo
0319ecb91f Reorder file format lists to be the same as sndfile.h and api.html
* Reorders the list of recognized file formats and their filename
  extensions and aliases in programs/common.c's format_map[] and in
  sndfile-convert.1 so that the list is in the same order as in
  sndfile.h and api.html

* Adds more types that we know but format_map[] didn't use, namely
  AVR and WAVEX

* Add more filename extension aliases, insipred by those recognized
  by SoX, namely "sph" for NIST and "prc" for WVE.

Patch-from: Jan Stary <hans@stare.cz>
2014-07-01 16:51:18 +10:00
Erik de Castro Lopo
852d6e612a tests/(floating_point|scale_clip)_test.def : Quote hex literals.
Versions of autogen before 5.18.1 accepted bare hexadecimal literals
but later versions need those hex literals quoted. See:

    https://sourceforge.net/p/autogen/bugs/162/
2014-06-30 18:32:14 +10:00
Erik de Castro Lopo
9b09b70042 tests/write_read_test.tpl : Rename 'long_file_okz' -> 'long_file_ok'. 2014-06-28 23:11:13 +10:00
Erik de Castro Lopo
9cae6da0b8 programs/*.c : More exit code fixes.
Patch-from: Jan Stary <hans@stare.cz>
2014-06-25 06:09:58 +10:00
Erik de Castro Lopo
0291af2be5 programs/sndfile-cmp.c : Fix up exit status.
Patch-from: Jan Stary <hans@stare.cz>
2014-06-24 19:33:19 +10:00