Commit Graph

4509 Commits

Author SHA1 Message Date
Cristian Rodríguez 0c8afdf35a
fix invalid C23 in process_frame_thread_ (#649)
process_frame_thread_ should return NULL instead of false,
in C23 NULL and _Bool are not compatible and the code is rightfully
rejected by the compiler.

"stream_encoder.c:3595:48: error: incompatible types when returning type
‘_Bool’ but ‘void *’ was expected"
2024-03-05 13:18:25 +01:00
Martijn van Beurden 4194eb677e Let libFLAC send an error when frames are missing 2024-03-03 21:45:17 +01:00
Martijn van Beurden ab99a4b56b Add check that sample/frame number increases correctly 2024-03-03 21:45:17 +01:00
Martijn van Beurden 66152791d8
Let `flac -t` parse all metadata blocks (#626) 2024-03-01 08:50:35 +01:00
Martijn van Beurden 7f7da558f5 Remove checks for semaphore.h in CMake and configure 2024-02-26 21:54:37 +01:00
Martijn van Beurden 82c23ba31a Add more explanation to threading code 2024-02-26 21:54:37 +01:00
Martijn van Beurden 1cea6bb5be Switch from semaphores to mutexes, remove extra debug checks 2024-02-26 21:54:37 +01:00
Martijn van Beurden 9e93c4526b Add extra debug checks for threading 2024-02-26 21:54:37 +01:00
Martijn van Beurden eb59fbe89e Add explanation as to how threading works 2024-02-26 21:54:37 +01:00
Martijn van Beurden 72787c3fee
Add documentation on foreign metadata storage format 2023-11-24 13:45:21 +01:00
Martijn van Beurden 8cf7e7fbb5 Update API version numbers and ABI dumps 2023-09-22 21:10:15 +02:00
Martijn van Beurden 0118be95f9 [CI] Also upload compat reports on failure 2023-09-22 21:10:15 +02:00
Martijn van Beurden c227be6c12 Add multithreading to libFLAC++ and more fuzzers 2023-09-22 21:10:15 +02:00
Martijn van Beurden 8c41e7f62e Add multithreading to CMake 2023-09-22 21:10:15 +02:00
Martijn van Beurden d2f0a1a812 Add multithreading to API documentation and man page 2023-09-22 21:10:15 +02:00
Martijn van Beurden e0ebc8eb7e Limit max number of threads in case of fuzzing
Fuzzing with memory sanitizer gave out-of-memory failures
2023-09-22 21:10:15 +02:00
Martijn van Beurden c1f0eb4bea Raise max number of threads, improve thread testing 2023-09-22 21:10:15 +02:00
Martijn van Beurden 790b759072 Simplify mutex scheme and fix some bugs 2023-09-22 21:10:15 +02:00
Martijn van Beurden 021e82bfcc Add checks for 'overcommitting'
This scales the number of active threads back when threads have to
wait for work too often
2023-09-22 21:10:15 +02:00
Martijn van Beurden bcc37540aa Fix threads busy waiting for MD5 2023-09-22 21:10:15 +02:00
Martijn van Beurden c4cddca335 Rearrange, use mutexes instead of semaphores at some points
Also, don't rely on pthread_cancel anymore
2023-09-22 21:10:15 +02:00
Martijn van Beurden 9abbcd4184 Enable main thread to code frame instead of idle 2023-09-22 21:10:15 +02:00
Martijn van Beurden df5dc22cbf Move MD5 calculation from main thread to workers 2023-09-22 21:10:15 +02:00
Martijn van Beurden d41127f860 Make it possible for threads to leapfrog each other 2023-09-22 21:10:15 +02:00
Martijn van Beurden a4b8b0f0f2 Queue two tasks per thread
This should improve multithreading throughput
2023-09-22 21:10:15 +02:00
Martijn van Beurden 2dfd4dad60 Try to get multithreading working on MacOS 2023-09-22 21:10:15 +02:00
Martijn van Beurden cb190cc0a8 Add multithreading to tests 2023-09-22 21:10:15 +02:00
Martijn van Beurden 37194bb4bd Add multithreading option to flac command line tool 2023-09-22 21:10:15 +02:00
Martijn van Beurden c29735769c Add multithreaded fuzzing to fuzzer_encoder_v2 2023-09-22 21:10:15 +02:00
Martijn van Beurden 2a3f1efebc Mute output of fuzzer_encoder_v2 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 4201109057 Pass threadctx to calls that will need that 2023-09-22 21:10:15 +02:00
Martijn van Beurden 0780ef0ecf Move thread stuff to own struct 2023-09-22 21:10:15 +02:00
Martijn van Beurden 68d01aaea5 Add checking for pthread to configure 2023-09-22 21:10:15 +02:00
Lee Carré 2a29eae030
Documentation (man/flac.md); fix typo (#644)
Section: `Apodization functions`

From:

> For partial_tukey(n) and punchout_tukey(n), […] The use of this is
> that different parts of a block are ignored as the might contain
> transients which are hard to predict anyway. […]

to (emphasis added only in this summary, not in the source):

> For partial_tukey(n) and punchout_tukey(n), […] The use of this is
> that different parts of a block are ignored as the**y** might contain
> transients which are hard to predict anyway. […]
2023-09-03 20:09:35 +02:00
manx 31ccd3df31
Use correct argument type for _BitScanReverse and _BitScanReverse64. (#638)
_BitScanReverse and _BitScanReverse64 are documented to take an `unsigned long *` as the first argument (see <https://learn.microsoft.com/en-us/cpp/intrinsics/bitscanreverse-bitscanreverse64?view=msvc-170>), however libFLAC used `uint32_t` which happens to be `unsigned int`.

This silences Clang warning `incompatible pointer types passing 'uint32_t *' (aka 'unsigned int *') to parameter of type 'unsigned long *' [-Wincompatible-pointer-types]`.

Fixes https://github.com/xiph/flac/issues/637
See also https://github.com/xiph/flac/pull/638 for comments
2023-07-27 12:11:07 +02:00
Martijn van Beurden 6c126e9308
Limit the number of clock() calls
The overhead of calling clock() when encoding/decoding very small
frames turned out to be very large, for framesize 16 these syscalls
took over half the execution time. This commit only calls clock()
when at least 10.000 samples have been encoded or 25.000 samples
have been decoded since the last call to clock()
2023-07-07 20:31:23 +02:00
Martijn van Beurden 28e4f0528c
Release FLAC 1.4.3 2023-06-23 09:17:08 +02:00
Martijn van Beurden c7fc1768e8
Fix library version numbers/sonames 2023-06-21 17:09:24 +02:00
Martijn van Beurden 08f8af0845
Improve on "Check for got_stream_info instead of samplerate being 0"
This improves on commit 6db29d1. It turns that commit broke some
parsing, this fixes it
2023-06-18 20:32:27 +02:00
Martijn van Beurden d80e574451
Explain use of errno with callbacks 2023-06-16 06:46:57 +02:00
Martijn van Beurden 4f9be8620b
Add github action to check against flac test files 2023-06-15 19:46:38 +02:00
Martijn van Beurden e00d9b881f
Update copyright year and maintainer status 2023-06-06 22:08:24 +02:00
Martijn van Beurden 7f89a74cb2
Slim down CI 2023-06-06 18:03:32 +02:00
Martijn van Beurden c0fc3c73e2
Update changelog 2023-06-06 09:30:50 +02:00
Martijn van Beurden fd890034a5
Fix compression level 8 in API docs 2023-06-01 19:16:03 +02:00
Martijn van Beurden 6a9c1664b3
Check that seektable length > 0 2023-06-01 16:50:27 +02:00
Martijn van Beurden d6974b9702
Remove sector align option
This option has been deprecated since FLAC 1.3.0.
2023-05-31 21:49:44 +02:00
Martijn van Beurden 1619af5a36
Update changelog and library version numbers 2023-05-30 07:41:35 +02:00
Martijn van Beurden 0b8a271b3e
Fix version number display on Windows
This adds windows-specific version information to build objects

Co-authored-by: Ozkan Sezer <sezeroz@gmail.com>
2023-05-24 14:52:13 +02:00