Commit Graph

587 Commits

Author SHA1 Message Date
Martijn van Beurden d2f0a1a812 Add multithreading to API documentation and man page 2023-09-22 21:10:15 +02:00
Martijn van Beurden acf6f8ff11 Add multithreading to libFLAC 2023-09-22 21:10:15 +02:00
Martijn van Beurden d80e574451
Explain use of errno with callbacks 2023-06-16 06:46:57 +02:00
Martijn van Beurden e00d9b881f
Update copyright year and maintainer status 2023-06-06 22:08:24 +02:00
Martijn van Beurden fd890034a5
Fix compression level 8 in API docs 2023-06-01 19:16:03 +02:00
Martijn van Beurden 1619af5a36
Update changelog and library version numbers 2023-05-30 07:41:35 +02:00
Martijn van Beurden 22fffdceb8 Check for overflow when multiplying skip samples with sample size
Credit: Oss-Fuzz
Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=58606
2023-05-08 19:39:08 +02:00
Martijn van Beurden 00cb41ee03 Add use of x86 BMI2 to bitreader_read_rice_signed_block 2023-03-27 22:10:00 +02:00
Martijn van Beurden b11677e052 Add API function FLAC__metadata_object_set_raw
Add an API function to directly input binary FLAC data to get a
FLAC__StreamMetadata struct. The use mirrors
FLAC__metadata_object_get_raw
2023-03-19 22:37:40 +01:00
Martijn van Beurden b54eabdf0d Add API function FLAC__metadata_object_get_raw
Add an API function to directly output binary FLAC data corresponding
to a certain FLAC__StreamMetadata struct
2023-03-19 22:37:40 +01:00
Martijn van Beurden 8daf62da0c Rename fuzzer source files to simplify oss-fuzz build script 2023-02-21 15:56:40 +01:00
Martijn van Beurden 3baaf23faa
Add warning that md5 functions are used elsewhere 2023-02-21 08:16:46 +01:00
Martijn van Beurden 0a52c6fd5c
Replace own bool with stdbool.h, check for header being available 2023-01-07 09:58:00 +01:00
Martijn van Beurden a73e70c8f4 Also check asserts in fuzzing 2022-11-09 07:19:31 +01:00
Martijn van Beurden 396313c9d0 [doxygen] Change links from local to xiph.org/flac 2022-10-19 17:09:57 +02:00
Ozkan Sezer c0a6701bc0 fix a typo in stream_encoder.h
fixes doxygen error:
include/FLAC/stream_encoder.h:1298: Error: Unexpected character `"'
2022-10-19 17:09:57 +02:00
Martijn van Beurden 3f4ba7620c Change C++ style comments to C style in headers 2022-09-20 19:54:32 +02:00
Martijn van Beurden 87c3d8a0d9 Fix a lot of Doxygen errors and add some documentation 2022-09-20 19:54:32 +02:00
Martijn van Beurden 89a1620c42 Update API and tool docs 2022-09-20 19:54:32 +02:00
Martijn van Beurden dc12a9e2f6
Add struct tag to FLAC__StreamMetadata (#416) 2022-08-29 20:35:19 +02:00
Martijn van Beurden fbb6cb5c07 Add OOM checking to fuzzing 2022-08-20 16:03:53 +02:00
Martijn van Beurden 707dace4bd Leave metadata items untouched if resize function fails 2022-08-20 16:03:53 +02:00
Martijn van Beurden 21fe95ee82 Add and use _nofree variants of safe_realloc functions
Parts of the code use realloc like

x = safe_realloc(x, somesize);

when this is the case, the safe_realloc variant used must free the
old memory block in case it fails, otherwise it will leak. However,
there are also instances in the code where handling is different:

if (0 == (x = safe_realloc(y, somesize)))
    return false

in this case, y should not be freed, as y is not set to NULL we
could encounter double frees. Here the safe_realloc_nofree
functions are used.
2022-08-20 16:03:53 +02:00
lutianxiong b715d7b9fe fix potential memleak 2022-08-20 16:03:53 +02:00
Martijn van Beurden 3022dad831
Fix and warning for MSVC with Windows XP toolset (#399)
A warning and a small workaround is added for building
libFLAC on MSVC with a specific Windows XP targeting toolset.
2022-08-06 20:32:28 +02:00
Martijn van Beurden 05ff569266 Finish porting guide 2022-07-27 22:16:04 +02:00
Martijn van Beurden 42201ae575 Add porting guide stub 2022-07-27 22:16:04 +02:00
Martijn van Beurden 10d7ce268b Bulk update copyright dates to 2022 2022-07-26 16:23:07 +02:00
Martijn van Beurden 67131c04b8 Include stddef.h in compat.h
See https://github.com/xiph/flac/issues/76 for details

Also, move include of stddef.h and stdarg.h up to top of file to
make clear that they are included unconditionally
2022-07-19 17:33:29 +02:00
Martijn van Beurden 633ab36ec5
Small fixes needed for 32-bit capability (#379)
* Change replaygain analysis so it is able to handle 32-bit PCM
* Increase FLAC__REFERENCE_CODEC_MAX_BITS_PER_SAMPLE to 32
* Fix switch-case fallthrough
2022-07-01 07:36:48 +02:00
Martijn van Beurden 9df24ac202 Add 32-bit decoding capability
Decoding for 32-bit files is added, including the ability to decode
a 33-bit side subframe. However, residuals are assumed to be limited
to a 32-bit signed int, the encoder must make sure of this
2022-06-12 18:38:21 +02:00
Martijn van Beurden 1bb80c18da Small make distcheck fixes 2022-05-27 21:59:32 +02:00
Martijn van Beurden e0e9cc58b4 Remove all Visual Studio specific build files 2022-05-27 21:59:32 +02:00
Martijn van Beurden e5e99dcdc2
Simplify and merge win_utf8 files and remove from DLL interface
libFLAC DLLs were exposing windows_unicode_filename.h functions
because flac and metaflac needed to set flac_internal_set_utf8_
filenames. Files windows_unicode_filename.{c/h} and
win_utf8_io.[c/h] are merged, and all non-utf8 parts are removed.

With this commit, the libFLAC DLL interface is the same as the
libFLAC interface of shared libraries on other platforms
2022-05-17 22:05:45 +02:00
Martijn van Beurden becba351f0 Make it possible for fuzzer to disable instruction set optimizations
This should greatly increase code coverage of the encoder fuzzer
2022-05-11 10:34:49 +02:00
Martijn van Beurden 8b148b257e Rename FLAC__get_decoder_client_data to ...
... FLAC__stream_decoder_get_client_data. Also the function
definition was moved to its 'siblings'. This way, the function
fits better in the API with respect to naming.
2022-05-09 17:29:46 +02:00
Martijn van Beurden b5f4a1535c Add API functions to limit minimum bitrate
Quite a lot of decoders have trouble streaming or seeking in a
file with frames that only consist of constant subframes because
of the large difference between the largest and smallest subframe.

To remedy this, this commit makes it possible to disable the use
of constant subframes for the last subframe in case all others are
constant with a new API function. This means the minimum bitrate
for a FLAC file encoded with this function used is raised to
1bit/sample (i.e. 48kbit/s for 48kHz material). This commit also
adds tests to the test suite
2022-05-02 07:59:01 +02:00
Rosen Penev bfe5ff9455 change if checks to ifdef
More similar to the rest of the code.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-04-29 19:17:26 +02:00
Martijn van Beurden 1ca7b38f3c Add FLAC__STREAM_DECODER_ERROR_STATUS_BAD_METADATA 2022-04-20 12:06:42 +02:00
Martijn van Beurden b19ed90a5b
Remove api doc note untrue since commit c9c0d13
This has been untrue for almost 20 years now
2022-04-19 19:05:24 +02:00
Martijn van Beurden 7dd7f94822 Fix building both static and shared libs on MinGW with autotools
When building both static and shared libs on MinGW with autotools,
the build broke down without any error message. This commit makes
such a build work
2022-04-15 09:36:15 +02:00
Con Kolivas 24629435bb Add support in the encoder for up to 20 bit sample rates
Now that many DACs support up to 768kHz, add support for these
sample rates to the encoder. Files produced with these sample rates
are already decodable by the reference decoder. Update documentation
and tests accordingly.
2022-04-13 20:32:08 +02:00
NotTsunami 3bb5d8cd76 include: Escape number signs to suppress warnings
Doxygen sees '#' as a cross-reference, which this is not in this case. This will silence the following warning that pops up frequently when building with docs:

warning: explicit link request to 'defines' could not be resolved

The code shorthand tag was removed in include\FLAC\all.h to remain synonymous with other mentions of #define.
2019-11-19 16:14:47 +11:00
sezero 25305d685b Fix msvc build after commit b917d456
Closes: https://github.com/xiph/flac/issues/152
2019-10-19 14:51:05 +11:00
NY00123 7bc7aebc7c Replace unsigned with uint32_t in prototypes; Fixes DJGPP builds. 2019-10-19 12:51:38 +11:00
sezero b917d456d2 make dllexport work with compilers other than MSVC
the issue is, flac and metaflac exes rely on flac_internal_???_utf8()
procedures from windows_unicode_filenames.c and there is no easy way
to exclude them from exports without breaking things. So export them
explicitly (they are exported anyway w/o this patch), but add a FIXME
note about the kludge in windows_unicode_filenames.c.
2019-10-10 18:30:39 +11:00
sezero 19a0e99ac3 move the new public get_decoder_client_data function to public header. 2019-10-10 06:09:21 +11:00
Erik de Castro Lopo 04974d2715 Fix a number of gcc 9.2 compiler warnings 2019-09-15 16:14:36 +10:00
oreo639 01167efa6a Fix function redefinition on arm-none-eabi compilers 2019-09-15 11:35:36 +10:00
Rosen Penev 66dd7f05d7 Switch to utimensat for newer POSIX versions
Some libcs like uClibc-ng can optionally disable deprecated functions.
utime is one of them. When done so, both the header and the function go
missing.

This fixes flac_utime to work in such a situation.
2019-08-20 06:49:13 +10:00