Commit Graph

3826 Commits

Author SHA1 Message Date
Erik de Castro Lopo
b05c00186c win_utf8_io: Fix compile error
The function `set_filename_utf8` was defined as static, but the
prototype was missing `static`.
2016-02-02 09:33:16 +11:00
Erik de Castro Lopo
89a0fe1e15 test_streams: Use fopen instead of flac_fopen
test_streams doesn't create/open files with non-ascii filenames,
so there's no need in unicode support.

Patch-from: lvqcl <lvqcl.mail@gmail.com>
2016-02-02 09:20:02 +11:00
Erik de Castro Lopo
c225c4a6db Fix debug build for VS2005
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2016-02-02 09:16:51 +11:00
Erik de Castro Lopo
dd83474977 share/utf8: Add missing check
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2016-02-01 10:58:51 +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
7917b60bdb src/share/Makefile.am: Fix EXTRA_DIST
* Remove reference to deleted file charsetmap.h.
* Move utf8/iconvert.h from EXTRA_DIST to utf8_libutf8_la_SOURCES.

Reported-by: lvqcl <lvqcl.mail@gmail.com>
2016-01-31 12:35:57 +11:00
Erik de Castro Lopo
9d99f2db84 locale_hack.h: Fix comment
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2016-01-31 09:55:18 +11:00
Erik de Castro Lopo
c547600599 Remove plugin_common library from MSVC build
Previously src/plugin_common library was used by FLAC's own Winamp plugin
(MSVC/Windows) and by the XMMS plugin (*nix). The Winamp plugin is long
gone from FLAC tree, so plugin_common is unused on Windows.

Patch-from: lvqcl <lvqcl.mail@gmail.com>
2016-01-31 09:53:49 +11:00
Erik de Castro Lopo
ba18bd19a8 Fix dependencies for MSVC
Patch-from: lvqcl <lvqcl.mail@gmail.com>
2016-01-31 09:50:12 +11:00
Erik de Castro Lopo
04f7b241bc Remove src/share/utf8/charsetmap.h
It was added in 2002 but is not used anywhere.

Reported-by: lvqcl <lvqcl.mail@gmail.com>
2016-01-31 09:47:53 +11:00
Erik de Castro Lopo
aceddf31c9 Windows/MSVC utf8 build fixes
Files share/utf8/charset.c and share/utf8/iconvert.c aren't needed
under Windows. This patch removes them from MSVC build system.

Patch-from: lvqcl <lvqcl.mail@gmail.com>
2016-01-29 07:39:16 +11:00
Erik de Castro Lopo
4288e44605 microbench/util.c: Fix -Wshadow warning 2016-01-26 16:20:00 +11:00
Erik de Castro Lopo
7411724bc9 Fix ioctl/TIOCGWINSZ for OSX 2016-01-26 13:35:24 +11:00
Erik de Castro Lopo
3ff49e606d src/flac/utils.c: Fix for OpenBSD
OpenBSD defineds `TIOCGWINSZ` in `termios.h` which is already being
included, so this fix should work on most POSIX systems.

Closes: https://sourceforge.net/p/flac/bugs/435/
2016-01-26 13:03:31 +11:00
Erik de Castro Lopo
906ccc3901 autogen.sh: Improve autoconf/automake detection on OpenBSD
OpenBSD needs the enviroment variables `AUTOCONF_VERSION` and
`AUTOMAKE_VERSION` to be set in order to find these tools.

The script now tests (individually) if they are already set and if they
aren't sets them to something that is known to work on OpenBSD 5.8
2016-01-26 13:00:59 +11:00
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