2448 Commits

Author SHA1 Message Date
Erik de Castro Lopo
318ce3de97 RF64: Add string metadata read/write capabilities
Tests included.
2016-01-05 21:06:58 +11:00
Erik de Castro Lopo
379a216a85 Move more code from src/wav.c to src/wavlike.c
Yay for code reuse!
2016-01-05 13:41:34 +11:00
Erik de Castro Lopo
74b481c60a src/w64.c: Rename bext_MARKER to bext_HASH16
Needed to avoid name collision.
2016-01-05 11:55:33 +11:00
Erik de Castro Lopo
dc4ca2460e src/ms_adpcm.c: Remove un-needed #defines 2016-01-05 11:54:22 +11:00
Erik de Castro Lopo
1ae919208f Rename src/wav_w64.[ch] -> src/wavlike.[ch]
Intend to reuse some of the WAV parsing/generating code for RF64 and
thought the file names should reflect that. Also changed function
names in this file to match the filename.
2016-01-05 11:20:20 +11:00
Erik de Castro Lopo
9b3abb11c2 src/caf.c: Fix for 32 bit CPUs 2016-01-04 14:34:19 +11:00
Erik de Castro Lopo
b64b37777f Add tests for CAF string metadata read/write 2016-01-03 16:26:54 +11:00
Erik de Castro Lopo
662c659f46 src/caf.c: Add string metadata reading/writing 2016-01-03 16:13:00 +11:00
Erik de Castro Lopo
d9c61f22b6 src/strings.c: Clean up and fix debug code 2016-01-03 16:11:39 +11:00
Erik de Castro Lopo
decf19a555 src/(flac|w64).c: Minor log buffer format tweaks 2016-01-03 16:10:39 +11:00
Erik de Castro Lopo
dd97b5e799 src/common.c: Comments only 2016-01-03 12:48:51 +11:00
Erik de Castro Lopo
50ecb193ef src/caf.c: Prevent infinite loop on malformed file
Integer overflow found my American Fuzzy Lop.
2016-01-02 13:31:43 +11:00
Erik de Castro Lopo
5f28229755 CAF/ALAC: Improve error handling 2016-01-01 09:02:40 +11:00
Erik de Castro Lopo
8ae7bfab93 src/caf.c: Prevent infinite loop on malformed file
Found using American Fuzzy Lop.
2016-01-01 08:34:55 +11:00
Erik de Castro Lopo
fdd6b8c194 src/wav.c: Fix infinite loop in exif parser
Integer overflow found my American Fuzzy Lop.
2015-12-29 16:07:25 +11:00
Erik de Castro Lopo
1b93de430a AIFF: Handle channel count of -1 read from file 2015-12-29 15:35:05 +11:00
Erik de Castro Lopo
03cb3c46ff tests/floating_point_test.tpl: Fix compiler warning 2015-12-17 22:37:38 +11:00
Erik de Castro Lopo
f4e1bd389e src/w64.c: Fix padding of 'fmt ' chunk
As pointed out by Periklis Ntanasis <pntanasis@gmail.com> on the
libsndfile-user list, libsndfile was adding an un-needed 8 bytes
of padding to the 'fmt ' chunk.

VLC was failing to open the files with the extra padding.

libsndfile opens both the before and after files.
2015-12-08 20:20:26 +11:00
Erik de Castro Lopo
ab32880353 .travis.yml: Switch from Ubuntu Precise to Trusty 2015-12-07 19:28:22 +11:00
Erik de Castro Lopo
ebc444ff99 .travis.yml: Update before install 2015-12-07 14:55:26 +11:00
Erik de Castro Lopo
f29c0dc209 src/sndfile.c: Another seekable flag fix
Pointed out by Jeremy Friesner <jfriesne@gmail.com>.
2015-12-07 06:43:55 +11:00
Erik de Castro Lopo
cc77ff33bd configure.ac: Remove duplicate line 2015-12-06 15:24:46 +11:00
Erik de Castro Lopo
776308d728 src/sndfile.c: Fix seekable regression
This was broken as an unintended side-effect of 19e12f564.

Also add a test to tests/write_read_test.tpl.
2015-12-01 20:45:58 +11:00
Erik de Castro Lopo
bb6cd875af Remove all mentions of Carbon for OSX
Suport for Carbon was remove in 2012, but crept back in the same
year in an un-related commit.

Patch-from: Jan Stary <hans@stare.cz>
2015-11-27 06:16:38 +11:00
Erik de Castro Lopo
13e1fbf4fd Purge src/macbinary3.c
This was a place holder for functionality that was never implemented
and is now no longer needed.

Closes: https://github.com/erikd/libsndfile/issues/108
2015-11-26 17:06:53 +11:00
Kylie McClain
7fbbc35b1b Fix build on musl libc
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2015-11-24 06:18:45 +11:00
Erik de Castro Lopo
42991eac0d NEWS: Fix typo 2015-11-23 06:28:36 +11:00
Erik de Castro Lopo
d64cc5d559 doc/index.html: Fix comment about Windows versions 2015-11-22 21:35:57 +11:00
Erik de Castro Lopo
2f9c2945b4 configure.ac: 1.0.27pre1 2015-11-22 21:34:49 +11:00
Erik de Castro Lopo
f67f0992ea Version 1.0.26 2015-11-22 20:54:04 +11:00
Erik de Castro Lopo
b520099bbc tests/floating_point_test.tpl: Fix compiler warnings
* Clang complained about taking the absolute value of an unsigned number.
* GCC complained about a signed/unsigned compare operation.
2015-11-22 20:45:04 +11:00
Erik de Castro Lopo
53c9f0bcaf src/common.c: Pull fix from 1.0.25 2015-11-10 07:49:24 +11:00
Erik de Castro Lopo
f98d9588ba configure.ac: Improve <sndio.h> detection
Only test for it on OpenBSD.
2015-10-29 13:17:50 +11:00
Erik de Castro Lopo
e19adf46e1 programs/sndfile-play.c: Fix typo in comment
OpenBDS -> OpenBSD
2015-10-29 13:16:50 +11:00
Erik de Castro Lopo
2ec38064dd Add examples/sndfile-loopify.c 2015-10-26 09:24:14 +11:00
Erik de Castro Lopo
7e7041b502 Document SFC_RF64_AUTO_DOWNGRADE command 2015-10-21 09:29:55 +11:00
Erik de Castro Lopo
85bac419b8 tests/misc_test.c: Add SFC_RF64_AUTO_DOWNGRADE test 2015-10-20 13:46:21 +11:00
Erik de Castro Lopo
0d02750465 test_wrapper.sh.in: Cross compile to Windows fix 2015-10-20 13:46:21 +11:00
Erik de Castro Lopo
e815be825a RF64: Implement auto RF64 downgrade to WAV
The EBU recomendation is that when writing RF64 files and the
resulting file is less than 4Gig in size, it should be downgraded
to a WAV file (WAV files have a maximum size of 4Gig).

In libsndfile we don't quite follow the EBU recommendations, mainly
because the test suite needs to be able test reading/writing RF64
files without having to generate 4 gigabyte files. Therefore, by
default, libsndfile does not do an auto-downgrade. Instead, once
an RF64 file is has been opened for write, there is a command:

    sf_command (file, SFC_RF64_AUTO_DOWNGRADE, NULL, 0);

that will switch libsndfile to work as per the EBU recomendations.
This command has to be run for each and every RF64 file for which the
EBU recommended behaviour is desired.

Original patch by Paul Davis (linuxaudiosystems.com) but tweaked
slightly.
2015-10-20 13:46:11 +11:00
Erik de Castro Lopo
2f805f8d4c Add long read/write test for CAF/ALAC
This is to catch the bug that was fixed in 26dfda9b71 but may also
be useful for other block based lossless codecs.
2015-10-19 13:37:31 +11:00
Erik de Castro Lopo
309e09c0d0 tests/ : Test program improvements
* tests/channel_test.c
* tests/compression_size_test.c
2015-10-19 13:37:31 +11:00
Erik de Castro Lopo
fbb49e9739 tests/: Revise target values
* floating_point_test.tpl
* checksum_test.c
2015-10-19 12:49:33 +11:00
Erik de Castro Lopo
26dfda9b71 src/alac.c: Fix alac write bug
When the ALAC write float and double write function were passed buffers
longer than 4096 elements, the buffer offsets were being incorrectly
calculated resulting in incorrect data was being written to the file.
2015-10-19 12:49:17 +11:00
Erik de Castro Lopo
fc7a3bea72 tests/dft_cmp.c: Fix indexing error
Was incorrectly using `DFT_DATA_LENGTH` instead of `DFT_SPEC_LENGTH`
to index into `spectrum` array.
2015-10-19 12:44:23 +11:00
Erik de Castro Lopo
55f0beddc6 tests: Improvements to floating point tests
Two basic changes:

* Increase DFT_DATA_LENGTH to 8192.
* Fill the data to 5/6ths of the length instead of 1/2.

The first is designed to catch errors in CAF/alac encoding when passed
more than 4096 samples at a time. The second makes it easier to catch
this kind os problem.
2015-10-19 12:41:50 +11:00
Erik de Castro Lopo
d87b2319b0 src/sndfile.c: Fix SFC_SET_SCALE_FLOAT_INT_READ
Before this fix it was possible for a the float/double to short/int
conversion to cause wrap-around distortion.
2015-10-19 12:26:05 +11:00
Erik de Castro Lopo
4b14e45190 src/wav.c: Fix exif parser bug
Parsing malformed exif data could cause the parser to go into an
infinite loop.

Found using the American Fuzzy Lop fuzzer.
2015-09-27 20:15:39 +10:00
Erik de Castro Lopo
81761f6594 src/ALAC/alac_encoder.c: Simplify
Simplify on the basis that the rest of the code only supports 16, 20,
24 and 32 bits.
2015-08-24 19:54:45 +10:00
Erik de Castro Lopo
ec63d5765f configure.ac: Remove -fsanitize options
Previously, the address, integer and undefined sanitizers were all
enabled at once which doesn't always work.

Instead, compiling libsndfile with the sanitizer should be done with
for example:

    CFLAGS=-fsanitize=address CXXFLAGS=-fsanitize=address ./configure
2015-08-07 21:08:37 +10:00
Daniel Winzen
cd838a022e Fix memory leaks
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
Closes: https://github.com/erikd/libsndfile/pull/100
2015-08-07 20:19:24 +10:00