Commit Graph

551 Commits

Author SHA1 Message Date
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
lvqcl
edfbe3cf19 Move CreateFile_utf8 function to a more logical place 2018-08-25 18:55:30 +10:00
lvqcl
9fa2b5edba move CreateFile function outside of libFLAC 2018-08-19 15:12:26 +10:00
luz.paz
01eb19708c Fix miscellaneous typos.
Found via `codespell -q 3`
2018-05-24 07:20:19 +10:00
Erik de Castro Lopo
45f7d41a8a Fix for missing WINAPI_FAMILY_PARTITION
This is macro identifier is not defined, define it to `0`.
2018-02-10 13:37:55 +11:00
Thomas Zander
7d3f9baedf FLAC++: Add missing prototype for construct_block
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2017-06-23 19:42:49 +10:00
Erik de Castro Lopo
b762a20ace Fix missing SIZE_MAX definition on Android 2017-05-03 18:37:12 +10:00
Erik de Castro Lopo
25b2d82fe4 Fix typos in header files
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2017-03-21 05:39:29 +11:00
Keegan Drake H.P
5121d22e80 stream_decoder.h: Fix Reference to Non-Existent Functions
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
Closes: https://github.com/xiph/flac/pull/31
2017-03-16 20:29:30 +11:00
Keegan Drake H.P
d249bce935 stream_decoder.h: Fix References to ``stdout''
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2017-03-16 20:28:39 +11:00
Christian Stadelmann
841ed1aef9 stream encoder: fix documentation inconsistencies
Fixes https://sourceforge.net/p/flac/bugs/452/

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2017-02-13 19:42:46 +11:00
Rosen Penev
c669249e4c Fix compile with cygwin
The underscores are wrong. The comment is also correct.

Also remove the configure.ac option. Otherwise it tries to compile the
windows unicode stuff which POSIX(cygwin) does not understand.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2017-02-09 20:02:18 +11:00
Erik de Castro Lopo
33f093ae2f include/share/compat.h: Only define inline for C
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2017-01-24 06:20:06 +11:00
David Seifert
b3ece71334 Do not override CFLAGS, as CFLAGS is a user flag.
* Furthermore, use NDEBUG globally to detect the presence
  of building with more debug output information.
  AX_CHECK_ENABLE_DEBUG is easier to use, and nowadays
  Gnome has also switched to it from its own custom solution.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2017-01-19 20:47:26 +11:00
Erik de Castro Lopo
3be455142b Add missing file include/share/msvc2005_int.h 2017-01-19 11:17:01 +11:00
Erik de Castro Lopo
1e9e707c6f stdint.h fixes for MSVS 2005/2008
This adds a new msvc2005_int.h header file which is "force included"
as needed by the MSVS project file.

Patch-from: lvqcl <lvqcl.mail@gmail.com>
2017-01-19 06:33:33 +11:00
Erik de Castro Lopo
89a6c52067 metadata.h: Fix search/replace typo in comments 2017-01-17 19:41:44 +11:00
Erik de Castro Lopo
9bb7a7e0f5 Yet more unsigned fixes 2017-01-16 18:28:31 +11:00
Erik de Castro Lopo
71b909b7a4 Yet more purging of unsigned type 2017-01-15 09:48:42 +11:00
Erik de Castro Lopo
588689b138 include/FLAC: More unsigned fixes
These fixes are in the public API, but FLAC would have been extremely
unlikely to work in any system where `unsigned` was not 32 bits.
Therefore we do not treat this as an API change.
2017-01-14 20:24:13 +11:00
Erik de Castro Lopo
6b00dc26b2 Another bulk update of copyright dates 2016-12-05 19:07:13 +11:00
Erik de Castro Lopo
6a5fe43b7e Bulk update copyright dates 2016-12-05 06:35:39 +11:00
Erik de Castro Lopo
74e751c421 libFLAC: Set decoding status if write callback failed
Previously, it the write callback failed the error status
would be set to `FLAC__STREAM_DECODER_READ_FRAME`. Now it
gets set to `FLAC__STREAM_DECODER_WRITE_STATUS_ABORT`.

Patch-from: lvqcl <lvqcl.mail@gmail.com>
2016-07-13 19:42:25 +10:00
Erik de Castro Lopo
c4141f6132 Another Windows build fix
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2016-02-11 18:23:34 +11:00
Erik de Castro Lopo
ab61102209 More Windows fixes
These fixes got lost in an earlier commit.

Patch-from: lvqcl <lvqcl.mail@gmail.com>
2016-02-09 17:56:55 +11:00
Erik de Castro Lopo
52522f3a71 More make distcheck fixes
* Add two missing files to repo.
* Add files to Makefile.am `EXTRA_DIST` list.
2016-02-09 14:05:50 +11:00
Erik de Castro Lopo
d40a6bc695 libFLAC: Remove win_utf8_io dependency
Path-from: lvqcl <lvqcl.mail@gmail.com>
2016-02-08 22:04:12 +11:00
Erik de Castro Lopo
7be5df6c7f Refactoring of win_utf8_io
* Simplifies *print functions.
* Improves file related functions.
* Preparation to move all file related functions into libFLAC.

Patch-from: lvqcl <lvqcl.mail@gmail.com>
2016-01-31 12:42:26 +11:00
Erik de Castro Lopo
6c03ab204a Clean up #includes
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2016-01-24 08:08:55 +11:00
Erik de Castro Lopo
293d6b22cd macros.h: Make FLAC_CHECK_RETURN print to stderr
Also comment the fact that this macro should only be used for things
that are extremely unlikely to fail.
2016-01-19 18:20:25 +11:00
Erik de Castro Lopo
6cc1cbad2c libFLAC: Support 64bit brword/bwword
This patch allows FLAC__BYTES_PER_WORD to be set to 8, but is disabled by
default.

Patch-from: lvqcl <lvqcl.mail@gmail.com>
2016-01-04 10:31:35 +11:00
Erik de Castro Lopo
0a0e5363ad libFLAC: Tweak MSVC support
Visual Studio 2013 and newer has better support for C99.

Patch-from: lvqcl <lvqcl.mail@gmail.com>
2016-01-04 10:31:18 +11:00
Erik de Castro Lopo
46d3a4c6f1 Couple of minor tweaks
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2015-12-30 05:10:58 +11:00
Erik de Castro Lopo
e4399a02ae Whitespace only
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2015-12-25 09:39:34 +11:00
Thomas Zander
7189069e5e Explicitly use base class virtual methods; silence unnecessary warning
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2015-12-25 07:32:17 +11:00
Erik de Castro Lopo
a51b27c0ed Remove (defined _MSC_VER) from cpp workaround
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2015-12-10 06:12:19 +11:00
Erik de Castro Lopo
d9ae5e9128 libFLAC: Add function safe_realloc_()
The new function wraps, realloc() and if the realloc() fails, it
free()s the old pointer.

This is an improvement on the potential realloc() memory leak that
was fixed in 15a9062609.

Still needs fuzzing to validate it.
2015-08-22 19:39:37 +10:00