Commit Graph

3215 Commits

Author SHA1 Message Date
Erik de Castro Lopo
3418acc1f6 flac : Check compression ratio at end of encode process.
Stash the compression ratio in the EncoderSession struct and at the
end of the encode process, check if its > 1.0. Print an error message
if it is.
2013-07-21 22:10:27 +10:00
Erik de Castro Lopo
f34f31dac0 stream_encoder.c : Improve fix for arithmetic overflow.
The previous fix (patch 6f7ec60c) had the undesireable effect of slowing
down encoding speed on 16 bit files where the arithmetic overflow was
less likely to happen.

This fix forces the use of a FLAC__uint64 accumulator for 24 bit files
and restores the use of a FLAC_uint32 accumulator for 16 (and less) bit
files.

Unfortunately, I have not been able to prove to myself that this overflow
*cannot* happen with 16 bit files.
2013-07-21 21:05:31 +10:00
Erik de Castro Lopo
dd9460e7a5 Update .gitignore. 2013-07-21 20:12:41 +10:00
Erik de Castro Lopo
552917d9c1 src/share/grabbag/replaygain.c : Fix compiler warnings.
Gcc 4.8 has a new warning about use of un-initialized data. In particular
this new warning can detect if an automatic variable is defined in one function
and then passed to another and used before it is initialized.
2013-07-21 19:58:22 +10:00
Cristian Rodríguez
355f4aae47 Link with -no-undefined regardless of the OS
libFLAC* must never have undefined symbols no matter
what is the target platform.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2013-07-21 19:51:08 +10:00
Erik de Castro Lopo
33c23b3dfa src/libFLAC/bitwriter.c : Remove dead code. 2013-07-17 20:18:46 +10:00
Erik de Castro Lopo
6f7ec60c7e stream_encoder.c : Fix an arithmetic overflow in the RICE2 partitioner.
For a specific 24 bit WAV file provided by Leigh Dyer

    http://lists.xiph.org/pipermail/flac-dev/2013-July/004284.html

encoding with compression level 7 was generating a file a couple of
orders of magintude larger than the original.

Debugging showed that variable abs_residual_partition_sum (a FLAC__uint32)
in function precompute_partition_info_sums_() was suffering from an
arithmetic overflowing on some 24 bit input files although this value
overflowing did not always cause larger output files.

Since the value abs_residual_partition_sum is eventually stored in an
array of FLAC__uint64, it makes sense to make abs_residual_partition_sum
a FLAC__uint64 anyway.

Debugging this problem was made easier by use of the Clang compiler's
-fsanitize=integer option.
2013-07-17 19:42:12 +10:00
Erik de Castro Lopo
cf0277bde9 src/flac/utils.c : Add fflush after printing to stderr.
Patch from: MuldeR <mulder2@gmx.de>
2013-06-17 17:57:09 +10:00
Miroslav Lichvar
4eab6313cd Disable FLAC__bitreader_read_rice_signed_block_asm_ia32_bswap.
Don't use the assembly function since it seems to be slower than
the current version of FLAC__bitreader_read_rice_signed_block.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2013-06-06 19:57:21 +10:00
Miroslav Lichvar
606fdfcaec metaflac : Fix local_strcat() to terminate string correctly.
The NUL char is written at incorrect place when the destination string
is longer than 0, which causes memory corruption. It was broken by
commit 2d6354ff2a.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2013-06-05 18:50:42 +10:00
Cristian Rodríguez
d42c04260b Add missing config.h includes
All C and C++ files must include config.h

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2013-06-05 18:50:17 +10:00
Erik de Castro Lopo
21a70169f8 XMMS plugin : Fix symbol visibility.
FLAC now defaults to building with -fvisibility=hidden on GCC4-ELF
platforms.  This breaks the XMMS plugin.  At least get_iplugin_info()
needs to be externally visible.

Patch from Christian Weisgerber <naddy@mips.inka.de>
2013-06-05 18:48:25 +10:00
Erik de Castro Lopo
c7957b2b54 test/*.sh : Fix MALLOC_PERTURB initialization.
Was using '$(date +%N)', but that doesn't work on OSX or *BSD. Switched
to using '$(date +%s)'.
2013-05-27 19:23:42 +10:00
Ulrich Klauer
bd4af7e57b README : Update version number
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2013-05-27 18:10:31 +10:00
Ulrich Klauer
cd4ddabe0f Language fix: "difference licenses"
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2013-05-27 18:08:57 +10:00
Dagobert Michelsen
5999d81f0e Use location of TIOCGWINSZ from autoconf manual
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2013-05-27 18:06:56 +10:00
Dagobert Michelsen
349c6adcf7 Sun Studio can not include static function from extern inline
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2013-05-27 18:06:51 +10:00
Ulrich Klauer
0196c0f44c Properly close HTML comments
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2013-05-27 06:42:43 +10:00
Ulrich Klauer
5a01bf17dd src/flac/main.c : Fix copyright notice
There is no copyright for 2010, so "2000-2013" should not be used.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2013-05-27 06:42:16 +10:00
Ulrich Klauer
2bce0d60fe Declare UTF-8 encoding for changelog
The changelog declared "charset=ISO-8859-1", but used a UTF-8 encoded
name. Change the declaration to UTF-8 to fix this.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2013-05-27 06:41:17 +10:00
Xiyue Deng
b09ee0177c Fix bootstrap on Mac OS X
* Mac OS X has incomplete installations of gettext/iconv. So stop
  checking for gettext command on Darwin, and install some additional m4
  scripts so it can be bootstrapped on Mac OS X.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2013-05-27 06:20:08 +10:00
Erik de Castro Lopo
b1982fbc5f Set version to 1.3.0 and update coyprights throughout. 2013-05-26 19:17:53 +10:00
Ulrich Klauer
d672efaa05 Fix gcc version check for private macros
Use Benjamin Stiglitz' MIN macros from gcc 4.3 (according to the
changelog, __COUNTER__ was introduced in this version). Previously,
the macros weren't used on any existing gcc version; the first one
would have been 5.5.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2013-05-26 08:26:45 +10:00
Robert Kausch
411ba53c7b bitwriter.c : Add missing "extern" declaration
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2013-05-26 07:42:22 +10:00
Robert Kausch
bb79a59a9f Fix mistyped variable name
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2013-05-26 07:42:19 +10:00
Ulrich Klauer
c9f05ed210 Correctly initialize FLAC_API_SUPPORTS_OGG_FLAC
Commits a7e3705d05 and
a4c321e492, while trying to simplify how
the FLAC_API_SUPPORTS_OGG_FLAC global variable was initialized,
inadvertently caused it to be always set to false, whether Ogg support
was compiled in or not.

This commit reverts the relevant part to how it looked in the 1.2.1
release, which is verbose but correct.

The problem was found by Robert Kausch <robert.kausch@freac.org>.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2013-05-26 07:42:13 +10:00
Erik de Castro Lopo
d2122a0725 changelog.html : Added entries about RICE2 residue coding method. 2013-05-25 17:51:17 +10:00
Erik de Castro Lopo
d7a56a28dd Fix compiling for Android.
Patch from Janne Hyvärinen <cse@sci.fi>.
2013-05-25 17:12:27 +10:00
Martijn van Beurden
d4b68b2ba5 Replace dead anchor
This fixes a wrong link (dead anchor) in the Doxygen api documentation

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2013-05-25 16:56:35 +10:00
Erik de Castro Lopo
4ff213b9ab README : Remove reference to OS X Project Builder. 2013-05-01 08:08:11 +10:00
Ulrich Klauer
eaae8e05b7 Refer to configure.ac instead of configure.in
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2013-05-01 07:38:52 +10:00
Erik de Castro Lopo
395e4ff45f Purge old Mac OS X Project Builder directory. 2013-05-01 01:23:43 +10:00
Erik de Castro Lopo
2273cb92de Regenerate man/flac.1. 2013-04-30 17:47:49 +10:00
Ulrich Klauer
9aa4032342 Fix path to HTML documentation
In the flac(1) man page, fix the path to the HTML documentation. Patch
by Joshua Kwan <joshk@triplehelix.org>, taken from the Debian patch
tracker for flac 1.2.1-6 (02_doc_path.patch).

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2013-04-30 09:51:21 +10:00
Ulrich Klauer
aa285f3ac1 Use C locale when reading ReplayGain tag
When a locale is in effect that does not use the point as the decimal
mark (e.g., sv_SE or de_DE, which use a comma) and a ReplayGain tag is
read for --apply-replaygain-which-is-not-lossless, the gain value was
misinterpreted (e.g., "-2.29" truncated to "-2"). This is fixed by
resetting the locale to "C" temporarily, based on Josh Coalson's fix
of the dual case (writing ReplayGain tag) in commit cda02d3.

Patch by hhaamu@gmail.com, taken from the Debian patch tracker for
flac 1.2.1-6 (13_replaygain_c_locale.patch).

http://sourceforge.net/p/flac/bugs/380/

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2013-04-30 09:48:44 +10:00
Erik de Castro Lopo
c1ebd2caa4 Two minor compiled fixes for OS/2.
Patch from Dave Yeo <dave.r.yeo@gmail.com>.
2013-04-29 21:33:02 +10:00
Erik de Castro Lopo
1b1d05bb25 Version 1.3.0pre4. 2013-04-28 19:00:30 +10:00
Erik de Castro Lopo
f2e10fa8ec test/test_compression.sh : Test compression level 0 as well. 2013-04-28 19:00:30 +10:00
Erik de Castro Lopo
6ed380943b Document --apply-replaygain-which-is-not-lossless command line option. 2013-04-28 19:00:30 +10:00
Erik de Castro Lopo
03b9d5dd0d man/flac.sgml : Document --ignore-chunk-sizes option.
Also regenerate man/flac.1.
2013-04-28 19:00:30 +10:00
Erik de Castro Lopo
113ec9d806 src/flac/encode.c : Use flac_snprintf instead of sprintf. 2013-04-28 19:00:30 +10:00
Martijn van Beurden
690205baf3 Add set -e to stop test_metaflac.sh
test_metaflac.sh wasn't aborting when replaygain values were
incorrect because the die() function was embedded in a pipe.
set -e was added so the script exits with a non-zero exit code
when die is called in a pipe.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2013-04-26 06:33:37 +10:00
Erik de Castro Lopo
69c44a51de test/test_metaflac.sh: POSIXify embedded awk script.
The embedded awk script was using the 'lshift' function which
apparently only exists in GNU auk (gawk) and definitely does not
exist in mawk.

Thanks to Martijn van Beurden <mvanb1@gmail.com> for reporting
this issue.
2013-04-25 14:17:22 +10:00
Erik de Castro Lopo
4f24161246 Replace usage of $RANDOM in test scripts.
$RANDOM seems to be a bashism and isn't avaiable in eg dash.
2013-04-25 12:31:58 +10:00
Janne Hyvärinen
cc9f392166 Metaflac UTF-8 fixes (Windows)
Metaflac can now print all console supported characters from tags on the
screen. It also fixes metaflac to be able to import its own exports back
without non-ascii characters getting mutilated. And --no-utf8-convert
now works properly with import and export commands.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2013-04-25 08:58:08 +10:00
Martijn van Beurden
f6585b0bdc Reduce valgrind num-callers to 50
My Valgrind doesn't run, saying it doesn't support showing more
than 50 entries of a stack trace

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2013-04-22 17:43:01 +10:00
Martijn van Beurden
dec61cec91 Fixes setting test level and valgrind testing
This should enable using the disable-thorough-tests,
enable-exhaustive-tests and enable-valgrind-testing
configure switches, because setting these didn't do
anything

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2013-04-22 17:42:56 +10:00
Janne Hyvärinen
bf63268425 Fix status print staying on the wrong line with certain filename length.
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2013-04-21 21:47:33 +10:00
Erik de Castro Lopo
fc21768d44 Fix compile when compiling with FLAC__INTEGER_ONLY_LIBRARY.
Problem reported by Martijn van Beurden <mvanb1@gmail.com>.
2013-04-21 19:51:56 +10:00
Erik de Castro Lopo
ef40d9d4ca Fix -Wshadow warnings when compiling with mingw-gcc. 2013-04-21 19:31:54 +10:00