Commit Graph

3611 Commits

Author SHA1 Message Date
Erik de Castro Lopo d6c774c108 configure.ac: Drop -Wunreachable-code from CFLAGS
According to:

    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46158

this warning was removed in GCC 4.5.
2016-01-26 12:33:55 +11:00
Erik de Castro Lopo 09ca8abc67 configure.ac: Remove redundant `XIPH_ADD_CFLAGS([-Wextra])` 2016-01-25 10:12:33 +11:00
Tristan Matthews f56cdf9f5a doc: specify that quantized LPC shift must be non-negative
Refs http://sourceforge.net/p/flac/bugs/424/

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2016-01-25 07:20:29 +11:00
Erik de Castro Lopo 924cade2d9 Fix linking of microbenchmark program
On some setups, benchmark_residual linkage fails with an undefined
reference to clock_gettime(). Adding -lrt fixes that.

Patch-from: Ozkan Sezer <sezeroz@gmail.com>
2016-01-24 08:21:26 +11:00
Erik de Castro Lopo 2902974830 libFLAC/lpc.c: Fix comments
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2016-01-24 08:12:59 +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 e0b406f664 Fix three more cppcheck warnings
* src/flac/vorbiscomment.c:203: Uninitialized variable: converted.
* src/flac/vorbiscomment.c:210: Uninitialized variable: converted.
* src/test_libFLAC++/decoders.cpp:507: Memory leak: decoder.
2016-01-23 08:29:35 +11:00
Julien Nabet d908b292c9 Fix some cppcheck reports
* src/libFLAC/metadata_iterators.c:3247: (error) va_list `va` was opened
  but not closed with va_end().
* src/share/grabbag/snprintf.c:66: (error) va_list `va` was opened but
  not closed with va_end().
* src/utils/flactimer/main.cpp:84: (warning) Either the condition `!fout`
  is redundant or there is possible null pointer dereference.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
Closes: https://github.com/xiph/flac/pull/8
2016-01-23 07:45:54 +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 cc55e65182 grabbag: Fix comment in header
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2016-01-19 18:00:58 +11:00
Erik de Castro Lopo b7e12d6cc0 iffscan: Fix printf format strings
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2016-01-19 17:59:08 +11:00
Erik de Castro Lopo 4684608fb1 metadata_iterators.c: Add missing check for is_writable
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2016-01-16 07:58:03 +11:00
Erik de Castro Lopo cd567f7dcb flacdiff: Improve error msg output
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2016-01-10 13:04:32 +11:00
Thomas Zander 7eda006d2c Fix description of --rice-partition-order in flac -H
This is more of a "human language versus programmer parlor" issue.
src/flac/main.c will return usage error for an argument greater
than FLAC__MAX_RICE_PARTITION_ORDER (15u).
While in programming "0..16" usually means "from zero to 15", in
natural human-to-human talk, it would rather mean "from zero to 16".
This changes the wording a bit to avoid this misunderstanding.

Closes: http://sourceforge.net/p/flac/bugs/352/
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2016-01-10 08:33:52 +11:00
Erik de Castro Lopo 28817ba52f bitwriter: Add overflow check
The old version of `FLAC__bitwriter_write_raw_uint32()` assumes that the
unused bits of the `val` argument are equal to zero, but don't check it.

This patch adds a new version of that function which does have the check
and then calls a new function `FLAC__bitwriter_write_raw_uint32_nocheck()`
which behaves like the old one.

Code updated to use these two functions as needed.

Patch-from: lvqcl <lvqcl.mail@gmail.com>
2016-01-09 10:59:46 +11:00
Erik de Castro Lopo 262505bd90 libFLAC: Fix total_samples_estimate
See the SF ticket for details.

Patch-from: lvqcl <lvqcl.mail@gmail.com>
Closes: https://sourceforge.net/p/flac/bugs/351/
2016-01-09 10:46:44 +11:00
Erik de Castro Lopo d9f73a8ce6 Error out when asked to store an picture that is too large
Picture size must be smaller than the maximum block size.

Patch-from: lvqcl <lvqcl.mail@gmail.com>
2016-01-09 10:42:42 +11:00
Erik de Castro Lopo 27e00c8be0 flac/encode.c: Limit padding size
This prevents a too large padding value overflowing the block length.

Patch-from: lvqcl <lvqcl.mail@gmail.com>
Closes: https://sourceforge.net/p/flac/bugs/284/
2016-01-09 10:38:48 +11:00
Erik de Castro Lopo 1a5ba624a2 changelog.html: Start on 1.3.2 changelog entry 2016-01-08 21:39:02 +11:00
Thomas Zander 93c3a3897e Cleanup FLAC__bitmath_silog2()
- Retire 32bit variant of silog2(), since only the _wide variant is used
- Rename FLAC__bitmath_silog2_wide() to FLAC__bitmath_silog2()
- Replace existing implementation by shorter, clearer implementation
  using optimised routines from bitmath.h
- Update Copyright string to 2016 in changed files

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
Closes: https://github.com/xiph/flac/pull/6
2016-01-04 13:22:34 +11:00
Erik de Castro Lopo a3224c0434 configure.ac: Add --enable-64-bit-words option
The old 32 bit words the default which can be overridded with this
configure option.
2016-01-04 11:47:21 +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 ee06cabba5 test_libFLAC/bitwriter.c: Unify with bitwriter.c
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2015-12-31 07:37:17 +11:00
Erik de Castro Lopo 396999341a bitwriter.c: Cleanups and fixups
Assertions added, assertions simplified, unnecessary assignments
removed, mask calculations improved.

Patch-from: lvqcl <lvqcl.mail@gmail.com>
2015-12-31 07:32:39 +11:00
Erik de Castro Lopo cf7f1b5a02 bitmath.h: Cleanups
* Drop support from MSVC earlier than 2005.
* Make types of FLAC__clz_uint32() and FLAC__clz_soft_uint32() the same.
* Remove un-needed parens.
* Cleanup FLAC__bitmath_ilog2_wide().

Patch-from: lvqcl <lvqcl.mail@gmail.com>
2015-12-30 05:10:58 +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 a758365007 bitmath.h: Whitespace only
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2015-12-25 09:41:02 +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 02a9262e30 bitwriter.c: Fix undefined behaviour
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2015-12-20 19:40:40 +11:00
Erik de Castro Lopo 55910e61ac stream_encoder.c: Fix compiler warning
Remove incorrect assignment to `encoder->protected_->state`.
2015-12-13 11:33:55 +11:00
Erik de Castro Lopo f0ee453c23 Win32: Only use large buffers when writing to disk
Windows can suffer quite badly from disk fragmentations. To avoid
this, on Windows, the FILE* buffer size was set to 10Meg. However,
this huge buffer is undesireable when writing to a eg a pipe.

This patch updates the behaviour to only use the huge buffer when
writing to disk.

Patch-from: lvqcl <lvqcl.mail@gmail.com>
Closes: https://sourceforge.net/p/flac/feature-requests/114/
2015-12-12 08:30:29 +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 eb2af522a1 libFLAC/stream_encoder.c: Fix overflow in total_error_*
lvqvl found that 32-bit total_error_* variables can overflow when the
right encoding parameters are used. This patch disables them.

Patch-from: lvqcl <lvqcl.mail@gmail.com>
2015-11-25 05:42:43 +11:00
Erik de Castro Lopo 3fdb87b935 libFLAC/stream_encoder_intrin_*.c: More refactoring II
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2015-11-19 18:32:35 +11:00
Erik de Castro Lopo 2319a688ec libFLAC/stream_encoder_intrin_*.c: More refactoring
Combine two intrinsic instructions into one line of code.

Patch-from: lvqcl <lvqcl.mail@gmail.com>
2015-11-18 19:24:48 +11:00
Erik de Castro Lopo 3c56688aa2 libFLAC/stream_encoder_intrin_*.c: Refactor abs calculation
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2015-11-18 19:23:05 +11:00
Erik de Castro Lopo 6ec64d3c26 libFLAC/cpu.c: Whitespace
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2015-11-18 18:59:30 +11:00
Erik de Castro Lopo 826b64f37d libFLAC: Fix link error
The function FLAC__cpu_xgetbv_x86() is declared and defined only
if FLAC__HAS_X86INTRIN is defined. However FLAC__cpu_info() was
calling it even if FLAC__HAS_X86INTRIN was undefined,

Patch-from: lvqcl <lvqcl.mail@gmail.com>
2015-11-07 07:06:26 +11:00
Erik de Castro Lopo 86b36d92d5 libFLAC: Refactoring
No functional changes.

Patch-from: lvqcl <lvqcl.mail@gmail.com>
2015-11-03 18:08:56 +11:00
Thomas Zander 239843e5c1 Include proper headers for sysctlbyname() on Mac OS
According to Xcode documentation[1], sysctlbyname is available on
Mac OS via the same includes as on FreeBSD/DragonFly.

[1] https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/sysctlbyname.3.html

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2015-10-30 20:21:26 +11:00
Thomas Zander c05b7babed Makefile.lite: Include config.mk from top level build dir
Makefile.lite in libs/executables subdirs must include
top level's config.mk to allow variables defined there (OS, PROC)
to be used; otherwise e.g. EXPLICIT_LIBS is not set and link
fails on Darwin.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2015-10-30 20:21:26 +11:00
Thomas Zander c9128ad6a1 Make.lite: Proper detection Darwin/x86_64
- Use uname -m for Darwin/i386 platform
  (uname -p returns i386 on Mac OS)
- Darwin does have sys/param.h; allow correct flac_min/flac_max macro
  expansion

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2015-10-30 20:21:26 +11:00
Thomas Zander 20d721e66b Fix manpage: synonyms for encoding options -0 .. -8 now match the code
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2015-10-26 07:41:13 +11:00
lvqcl 165d7b1d07 stream_encoder.c: Fix subframe_bps comparison
libFLAC limits the value of qlp_coeff_precision to make sure that
32-bit math is enough for decoding of 16-bit audio.

subframe_bps can be equal to 17 for 16-bit input (for side channel)
so the value of subframe_bps should be compared with 17, not 16.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2015-10-14 06:34:24 +11:00
Erik de Castro Lopo 8d43282a90 libFLAC/cpu.c: Fix un-initialized variable
Suggested-by: lvqcl <lvqcl.mail@gmail.com>
2015-10-13 20:20:33 +11:00
Thomas Zander d20a79a8bd Let Makefile.lite build succeed on FreeBSD amd64
- build/config.mk: some OS call x86_64 amd64
- build/config.mk: FreeBSD needs -DHAVE_SYS_PARAM_H in CFLAGS
- build/exe.mk and lib.mk: default compilers on FreeBSD are cc/c++
- src/libFLAC++/Makefile.lite: $(OS) is not defined
- src/libFLAC++/Makefile.lite: Link -lstdc++ on FreeBSD

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2015-10-12 08:15:18 +11:00
Erik de Castro Lopo c671e1c91a flac: Error out if decoding RAW with bits != (8|16|24)
Suggested by Christopher Key.

Closes: https://sourceforge.net/p/flac/patches/43/
2015-10-04 10:52:27 +11:00
Erik de Castro Lopo efaab3c822 test/ : Use more portable echo constructs
Fix suggested by Daniel Macks.

Closes: https://sourceforge.net/p/flac/bugs/433/
2015-10-04 09:43:38 +11:00