[flac-dev] [GIT PULL] Assorted bugfixes and improvements (from openSUSE)

2012-03-29 Thread Cristian Rodríguez
The following changes since commit b78d8e4db10e57b8d82bb82e4e3662d5dedd7255:

   FLAC__bitmath_ilog2,FLAC__bitmath_ilog2_wide,COUNT_ZERO_MSBS: add gcc 
specific optimizations (2012-03-28 15:43:48 -0300)

are available in the git repository at:

   git://github.com/crrodriguez/flac.git master

for you to fetch changes up to 3a060556772c5d6a6464afddfda7c3ad2f93a306:

   Remove winamp2 plugin. (2012-03-29 13:51:24 -0300)


Cristian Rodríguez (4):
   Use a single source-code wide definition of min() and max()
   Support symbol visibility features present in GCC  4
   Remove xmms plugin. (project abandoned in 2007)
   Remove winamp2 plugin(native flac support is in winamp 5.3 6yr/old

  configure.ac   |   89 +--
  include/FLAC++/export.h|7 +-
  include/FLAC/export.h  |   26 +-
  m4/visibility.m4   |   77 ++
  src/Makefile.am|6 -
  src/flac/Makefile.am   |2 +-
  src/flac/encode.c  |   29 +-
  src/flac/foreign_metadata.c|7 +-
  src/libFLAC++/Makefile.am  |3 +-
  src/libFLAC++/metadata.cpp |4 +
  src/libFLAC++/stream_decoder.cpp   |4 +
  src/libFLAC++/stream_encoder.cpp   |4 +
  src/libFLAC/Makefile.am|6 +-
  src/libFLAC/bitreader.c|   13 +-
  src/libFLAC/bitwriter.c|   11 +-
  src/libFLAC/fixed.c|   16 +-
  src/libFLAC/lpc.c  |   16 +-
  src/libFLAC/metadata_iterators.c   |   15 +-
  src/libFLAC/ogg_decoder_aspect.c   |7 +-
  src/libFLAC/stream_decoder.c   |7 +-
  src/libFLAC/stream_encoder.c   |   48 +-
  src/libFLAC/stream_encoder_framing.c   |5 -
  src/metaflac/Makefile.am   |2 +-
  src/plugin_common/Makefile.am  |   48 --
  src/plugin_common/Makefile.lite|   36 -
  src/plugin_common/README   |2 -
  src/plugin_common/all.h|   26 -
  src/plugin_common/charset.c|  157 
  src/plugin_common/charset.h|   39 -
  src/plugin_common/defs.h   |   24 -
  src/plugin_common/dither.c |  262 ---
  src/plugin_common/dither.h |   29 -
  src/plugin_common/plugin_common_static.dsp |  128 
  src/plugin_common/plugin_common_static.vcproj  |  209 --
  src/plugin_common/replaygain.c |   64 --
  src/plugin_common/replaygain.h |   32 -
  src/plugin_common/tags.c   |  358 -
  src/plugin_common/tags.h   |   74 --
  src/plugin_winamp2/Makefile.am |   33 -
  src/plugin_winamp2/configure.c |  428 ---
  src/plugin_winamp2/configure.h |   49 --
  src/plugin_winamp2/in_flac.c   |  443 
  src/plugin_winamp2/in_flac.dsp |  154 
  src/plugin_winamp2/in_flac.vcproj  |  253 ---
  src/plugin_winamp2/include/Makefile.am |   18 -
  src/plugin_winamp2/include/winamp2/Makefile.am |   20 -
  src/plugin_winamp2/include/winamp2/in2.h   |  107 ---
  src/plugin_winamp2/include/winamp2/out.h   |   55 --
  src/plugin_winamp2/infobox.c   |  459 
  src/plugin_winamp2/infobox.h   |   28 -
  src/plugin_winamp2/playback.c  |  307 
  src/plugin_winamp2/playback.h  |   92 ---
  src/plugin_winamp2/resource.h  |   47 --
  src/plugin_winamp2/resource.rc |  236 --
  src/plugin_winamp2/tagz.cpp|  921 

  src/plugin_winamp2/tagz.h  |   32 -
  src/plugin_xmms/Makefile.am|   70 --
  src/plugin_xmms/Makefile.lite  |   43 --
  src/plugin_xmms/charset.c  |  198 -
  src/plugin_xmms/charset.h  |   56 --
  src/plugin_xmms/configure.c|  823 
-
  src/plugin_xmms/configure.h|   77 --
  src/plugin_xmms/fileinfo.c |  492 -
  src/plugin_xmms/http.c |  899 
---
  src/plugin_xmms/http.h |   26 -
  src/plugin_xmms/locale_hack.h  |   55 --
  src/plugin_xmms/plugin.c   |  684 --
  src/plugin_xmms/plugin.h   |   24 -
  src/plugin_xmms/tag.c  |  154 
  src

Re: [flac-dev] [GIT PULL] Assorted bugfixes and improvements (from openSUSE)

2012-03-29 Thread Cristian Rodríguez
El 29/03/12 14:32, Cristian Rodríguez escribió:
 The following changes since commit
 b78d8e4db10e57b8d82bb82e4e3662d5dedd7255:

 FLAC__bitmath_ilog2,FLAC__bitmath_ilog2_wide,COUNT_ZERO_MSBS: add gcc
 specific optimizations (2012-03-28 15:43:48 -0300)

 are available in the git repository at:

 git://github.com/crrodriguez/flac.git master

 for you to fetch changes up to 3a060556772c5d6a6464afddfda7c3ad2f93a306:

 Remove winamp2 plugin. (2012-03-29 13:51:24 -0300)

 
 Cristian Rodríguez (4):
 Use a single source-code wide definition of min() and max()
 Support symbol visibility features present in GCC  4
 Remove xmms plugin. (project abandoned in 2007)
 Remove winamp2 plugin(native flac support is in winamp 5.3 6yr/old



Please pull from commit b78d8e4db10e57b8d82bb82e4e3662d5dedd7255 
including that particular commit , I made a mistake in the since field.



___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [GIT PULL] Assorted bugfixes and improvements (from openSUSE)

2012-03-30 Thread Cristian Rodríguez
El 30/03/12 07:14, Erik de Castro Lopo escribió:

   * 7077ba8be2.. Use a single source-code wide definition of min() and max()

 I like the idea of this commit but don't understand why it modifies
 configure.ac. I also don't think the FLAC_SAFE_MIN/MAX defintions
 belong in the file include/FLAC/export.h which is a public header file.
 Instead, this definition belongs in one of the private/internal header
 files.

Yes, I didnt find the right header ;)


   * 8f05d0114c.. Support symbol visibility features present in GCC  4

 Again I like the idea of this patch, but I had in mind a solution to
 this problem which will work for a number of compilers other than just
 GCC.

The current version will work with clang, icc and gcc those define 
__GNUC__ and accept the -fvisibility-hidden flag


___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [GIT PULL] Assorted bugfixes and improvements (from openSUSE)

2012-03-30 Thread Cristian Rodríguez
El 30/03/12 07:14, Erik de Castro Lopo escribió:
 Cristian Rodríguez wrote:

 The following changes since commit b78d8e4db10e57b8d82bb82e4e3662d5dedd7255:

 FLAC__bitmath_ilog2,FLAC__bitmath_ilog2_wide,COUNT_ZERO_MSBS: add gcc
 specific optimizations (2012-03-28 15:43:48 -0300)

 are available in the git repository at:

 git://github.com/crrodriguez/flac.git master

 for you to fetch changes up to 3a060556772c5d6a6464afddfda7c3ad2f93a306:

 Hi Cristian,

 Thanks for your interest in improving FLAC. I will address your patches
 one-by-one.

   * b78d8e4db1.. 
 FLAC__bitmath_ilog2,FLAC__bitmath_ilog2_wide,COUNT_ZERO_MSBS: add gcc…

 +1. You sent me this patch in a private email and I was in the process
 of commiting a slightly modified version.

there is a tiny problem there. the preprocessor check for __builtin_clz

#if defined(__GNUC__)  ((__GNUC__ == 3  __GNUC_MINOR__ = 4) || 
__GNUC__ = 4)

So it compiles on very old systems...
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH] Fix buffer overflow in metaflac

2012-04-04 Thread Cristian Rodríguez
strlen() returns the length excluding the terminating null byte..then
an string of len 4 will be off-by-one in application_id[4];

GCC 4.7 detects this bug.
---
 src/metaflac/options.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/metaflac/options.c b/src/metaflac/options.c
index eb3498d..2cb0959 100644
--- a/src/metaflac/options.c
+++ b/src/metaflac/options.c
@@ -1040,7 +1040,7 @@ FLAC__bool parse_block_type(const char *in, 
Argument_BlockType *out)
out-entries[entry].type = 
FLAC__METADATA_TYPE_APPLICATION;
out-entries[entry].filter_application_by_id = (0 != r);
if(0 != r) {
-   if(strlen(r) == 4) {
+   if(strlen(r) == 3) {

strcpy(out-entries[entry].application_id, r);
}
else if(strlen(r) == 10  strncmp(r, 0x, 2) 
== 0  strspn(r+2, 0123456789ABCDEFabcdef) == 8) {
-- 
1.7.9.2

___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH] remove unnecesary typedef in bitwriter.c

2012-04-05 Thread Cristian Rodríguez
---
 src/libFLAC/bitwriter.c |   31 +++
 1 file changed, 15 insertions(+), 16 deletions(-)

diff --git a/src/libFLAC/bitwriter.c b/src/libFLAC/bitwriter.c
index 651440d..7da4b15 100644
--- a/src/libFLAC/bitwriter.c
+++ b/src/libFLAC/bitwriter.c
@@ -43,12 +43,11 @@
 
 /* Things should be fastest when this matches the machine word size */
 /* WATCHOUT: if you change this you must also change the following #defines 
down to SWAP_BE_WORD_TO_HOST below to match */
-/* WATCHOUT: there are a few places where the code will not work unless bwword 
is = 32 bits wide */
-typedef FLAC__uint32 bwword;
+/* WATCHOUT: there are a few places where the code will not work unless 
uint32_t is = 32 bits wide */
 #define FLAC__BYTES_PER_WORD 4
 #define FLAC__BITS_PER_WORD 32
 #define FLAC__WORD_ALL_ONES ((FLAC__uint32)0x)
-/* SWAP_BE_WORD_TO_HOST swaps bytes in a bwword (which is always big-endian) 
if necessary to match host byte order */
+/* SWAP_BE_WORD_TO_HOST swaps bytes in a uint32_t (which is always big-endian) 
if necessary to match host byte order */
 #if WORDS_BIGENDIAN
 #define SWAP_BE_WORD_TO_HOST(x) (x)
 #else
@@ -61,9 +60,9 @@ typedef FLAC__uint32 bwword;
  * a frame or metadata block, then write that out and clear the buffer for the
  * next one.
  */
-static const unsigned FLAC__BITWRITER_DEFAULT_CAPACITY = 32768u / 
sizeof(bwword); /* size in words */
+static const unsigned FLAC__BITWRITER_DEFAULT_CAPACITY = 32768u / 
sizeof(uint32_t); /* size in words */
 /* When growing, increment 4K at a time */
-static const unsigned FLAC__BITWRITER_DEFAULT_INCREMENT = 4096u / 
sizeof(bwword); /* size in words */
+static const unsigned FLAC__BITWRITER_DEFAULT_INCREMENT = 4096u / 
sizeof(uint32_t); /* size in words */
 
 #define FLAC__WORDS_TO_BITS(words) ((words) * FLAC__BITS_PER_WORD)
 #define FLAC__TOTAL_BITS(bw) (FLAC__WORDS_TO_BITS((bw)-words) + (bw)-bits)
@@ -85,8 +84,8 @@ static const unsigned FLAC__BITWRITER_DEFAULT_INCREMENT = 
4096u / sizeof(bwword)
 #endif
 
 struct FLAC__BitWriter {
-   bwword *buffer;
-   bwword accum; /* accumulator; bits are right-justified; when full, 
accum is appended to buffer */
+   uint32_t *buffer;
+   uint32_t accum; /* accumulator; bits are right-justified; when full, 
accum is appended to buffer */
unsigned capacity; /* capacity of buffer in words */
unsigned words; /* # of complete words in buffer */
unsigned bits; /* # of used bits in accum */
@@ -96,7 +95,7 @@ struct FLAC__BitWriter {
 static FLAC__bool bitwriter_grow_(FLAC__BitWriter *bw, unsigned bits_to_add)
 {
unsigned new_capacity;
-   bwword *new_buffer;
+   uint32_t *new_buffer;
 
FLAC__ASSERT(0 != bw);
FLAC__ASSERT(0 != bw-buffer);
@@ -118,7 +117,7 @@ static FLAC__bool bitwriter_grow_(FLAC__BitWriter *bw, 
unsigned bits_to_add)
FLAC__ASSERT(new_capacity  bw-capacity);
FLAC__ASSERT(new_capacity = bw-words + ((bw-bits + bits_to_add + 
FLAC__BITS_PER_WORD - 1) / FLAC__BITS_PER_WORD));
 
-   new_buffer = safe_realloc_mul_2op_(bw-buffer, sizeof(bwword), 
/*times*/new_capacity);
+   new_buffer = safe_realloc_mul_2op_(bw-buffer, sizeof(uint32_t), 
/*times*/new_capacity);
if(new_buffer == 0)
return false;
bw-buffer = new_buffer;
@@ -160,7 +159,7 @@ FLAC__bool FLAC__bitwriter_init(FLAC__BitWriter *bw)
 
bw-words = bw-bits = 0;
bw-capacity = FLAC__BITWRITER_DEFAULT_CAPACITY;
-   bw-buffer = malloc(sizeof(bwword) * bw-capacity);
+   bw-buffer = malloc(sizeof(uint32_t) * bw-capacity);
if(bw-buffer == 0)
return false;
 
@@ -525,7 +524,7 @@ FLAC__bool 
FLAC__bitwriter_write_rice_signed_block(FLAC__BitWriter *bw, const FL
 
FLAC__ASSERT(0 != bw);
FLAC__ASSERT(0 != bw-buffer);
-   FLAC__ASSERT(parameter  8*sizeof(bwword)-1);
+   FLAC__ASSERT(parameter  8*sizeof(uint32_t)-1);
/* WATCHOUT: code does not work with 32bit words; we can make things 
much faster with this assertion */
FLAC__ASSERT(FLAC__BITS_PER_WORD = 32);
 
@@ -536,8 +535,8 @@ FLAC__bool 
FLAC__bitwriter_write_rice_signed_block(FLAC__BitWriter *bw, const FL
msbits = uval  parameter;
 
 #if 0 /* OPT: can remove this special case if it doesn't make up for the extra 
compare (doesn't make a statistically significant difference with msvc or 
gcc/x86) */
-   if(bw-bits  bw-bits + msbits + lsbits = 
FLAC__BITS_PER_WORD) { /* i.e. if the whole thing fits in the current bwword */
-   /* ^^^ if bw-bits is 0 then we may have filled the 
buffer and have no free bwword to work in */
+   if(bw-bits  bw-bits + msbits + lsbits = 
FLAC__BITS_PER_WORD) { /* i.e. if the whole thing fits in the current uint32_t 
*/
+   /* ^^^ if bw-bits is 0 then we may have filled the 
buffer and have no free uint32_t to work in */
bw-bits = bw-bits + msbits + 

[flac-dev] [PATCH 2/2] V2: Use a single definition of MIN and MAX in sources

2012-04-05 Thread Cristian Rodríguez
---
 configure.ac |7 +
 src/libFLAC/bitreader.c  |   12 ++---
 src/libFLAC/bitwriter.c  |8 ++
 src/libFLAC/fixed.c  |   18 +
 src/libFLAC/format.c |8 ++
 src/libFLAC/include/private/macros.h |   29 
 src/libFLAC/metadata_iterators.c |   17 +++-
 src/libFLAC/ogg_decoder_aspect.c |7 ++---
 src/libFLAC/stream_decoder.c |8 ++
 src/libFLAC/stream_encoder.c |   49 ++
 src/libFLAC/stream_encoder_framing.c |5 
 11 files changed, 77 insertions(+), 91 deletions(-)
 create mode 100644 src/libFLAC/include/private/macros.h

diff --git a/configure.ac b/configure.ac
index d2501bb..7627fb7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,6 +22,10 @@ AC_INIT(src/flac/main.c)
 AM_INIT_AUTOMAKE(flac, 1.2.1)
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
+
+#Prefer whatever the current ISO standard is.
+AC_PROG_CC_STDC
+AC_USE_SYSTEM_EXTENSIONS
 # Enable the generation of shared libraries under Win32
 AC_LIBTOOL_WIN32_DLL
 
@@ -60,6 +64,7 @@ AC_HEADER_STDC
 AM_PROG_CC_C_O
 AC_C_INLINE
 AC_C_VARARRAYS
+AC_C_TYPEOF
 
 AC_CHECK_HEADERS(stdint.h)
 AC_SUBST(HAVE_STDINT_H)
@@ -68,6 +73,8 @@ AC_SUBST(HAVE_INTTYPES_H)
 AC_CHECK_HEADERS(byteswap.h)
 AC_SUBST(HAVE_BYTESWAP_H)
 
+AC_CHECK_HEADERS([sys/param.h])
+
 XIPH_C_BSWAP32
 
 XIPH_C_FIND_ENDIAN
diff --git a/src/libFLAC/bitreader.c b/src/libFLAC/bitreader.c
index cd05a62..7e17fd8 100644
--- a/src/libFLAC/bitreader.c
+++ b/src/libFLAC/bitreader.c
@@ -38,6 +38,7 @@
 #include private/bitmath.h
 #include private/bitreader.h
 #include private/crc.h
+#include private/macros.h
 #include FLAC/assert.h
 #include share/endswap.h
 
@@ -109,15 +110,6 @@ static const unsigned char byte_to_unary_table[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 };
 
-#ifdef min
-#undef min
-#endif
-#define min(x,y) ((x)(y)?(x):(y))
-#ifdef max
-#undef max
-#endif
-#define max(x,y) ((x)(y)?(x):(y))
-
 /* adjust for compilers that can't understand using LLU suffix for uint64_t 
literals */
 #ifdef _MSC_VER
 #define FLAC__U64L(x) x
@@ -547,7 +539,7 @@ FLAC__bool FLAC__bitreader_skip_bits_no_crc(FLAC__BitReader 
*br, unsigned bits)
FLAC__uint32 x;
 
if(n != 0) {
-   m = min(8-n, bits);
+   m = flac_min(8-n, bits);
if(!FLAC__bitreader_read_raw_uint32(br, x, m))
return false;
bits -= m;
diff --git a/src/libFLAC/bitwriter.c b/src/libFLAC/bitwriter.c
index 7da4b15..44914d1 100644
--- a/src/libFLAC/bitwriter.c
+++ b/src/libFLAC/bitwriter.c
@@ -37,6 +37,7 @@
 #include string.h
 #include private/bitwriter.h
 #include private/crc.h
+#include private/macros.h
 #include FLAC/assert.h
 #include share/alloc.h
 #include share/endswap.h
@@ -67,11 +68,6 @@ static const unsigned FLAC__BITWRITER_DEFAULT_INCREMENT = 
4096u / sizeof(uint32_
 #define FLAC__WORDS_TO_BITS(words) ((words) * FLAC__BITS_PER_WORD)
 #define FLAC__TOTAL_BITS(bw) (FLAC__WORDS_TO_BITS((bw)-words) + (bw)-bits)
 
-#ifdef min
-#undef min
-#endif
-#define min(x,y) ((x)(y)?(x):(y))
-
 /* adjust for compilers that can't understand using LLU suffix for uint64_t 
literals */
 #ifdef _MSC_VER
 #define FLAC__U64L(x) x
@@ -288,7 +284,7 @@ FLaC__INLINE FLAC__bool 
FLAC__bitwriter_write_zeroes(FLAC__BitWriter *bw, unsign
return false;
/* first part gets to word alignment */
if(bw-bits) {
-   n = min(FLAC__BITS_PER_WORD - bw-bits, bits);
+   n = flac_min(FLAC__BITS_PER_WORD - bw-bits, bits);
bw-accum = n;
bits -= n;
bw-bits += n;
diff --git a/src/libFLAC/fixed.c b/src/libFLAC/fixed.c
index 1a57cf4..05b289a 100644
--- a/src/libFLAC/fixed.c
+++ b/src/libFLAC/fixed.c
@@ -37,6 +37,7 @@
 #include string.h
 #include private/bitmath.h
 #include private/fixed.h
+#include private/macros.h
 #include FLAC/assert.h
 
 #ifndef M_LN2
@@ -44,11 +45,6 @@
 #define M_LN2 0.69314718055994530942
 #endif
 
-#ifdef min
-#undef min
-#endif
-#define min(x,y) ((x)  (y)? (x) : (y))
-
 #ifdef local_abs
 #undef local_abs
 #endif
@@ -242,11 +238,11 @@ unsigned FLAC__fixed_compute_best_predictor(const 
FLAC__int32 data[], unsigned d
error -= last_error_3; total_error_4 += local_abs(error); 
last_error_3 = save;
}
 
-   if(total_error_0  min(min(min(total_error_1, total_error_2), 
total_error_3), total_error_4))
+   if(total_error_0  flac_min(flac_min(flac_min(total_error_1, 
total_error_2), total_error_3), total_error_4))
order = 0;
-   else if(total_error_1  min(min(total_error_2, total_error_3), 
total_error_4))
+   else if(total_error_1  flac_min(flac_min(total_error_2, 
total_error_3), total_error_4))
order = 1;
-   else 

Re: [flac-dev] [PATCH] Fix buffer overflow in metaflac

2012-04-05 Thread Cristian Rodríguez
El 05/04/12 18:30, Brian Willoughby escribió:
 Agreed.  I was going to suggest memcpy() or something equivalent,
 because the FLAC structure is not literally a C string, but rather a
 32-bit field that may or may not have a terminating NULL.  Erik's
 code should work correctly in all cases.

Yep, and a fix is already in git ;)



___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH 2/2] Update and improve autotools build

2012-04-07 Thread Cristian Rodríguez
- INCLUDES is deprecated, and CPPFLAGS is an user-defined
  variable, use the proper AM_CPPFLAGS instead

- Remove FLAC__INLINE definition, providing proper
  replacement for MSVC compilers.

- Detect if we have C99 's lround and provide a replacement
  for windows...
---
 configure.ac   |   32 
 examples/c/decode/file/Makefile.am |2 +-
 examples/c/encode/file/Makefile.am |2 +-
 examples/cpp/decode/file/Makefile.am   |2 +-
 examples/cpp/encode/file/Makefile.am   |2 +-
 include/FLAC++/Makefile.am |2 +-
 src/flac/Makefile.am   |2 +-
 src/libFLAC++/Makefile.am  |2 +-
 src/libFLAC/Makefile.am|5 +++--
 src/libFLAC/bitreader.c|   14 +---
 src/libFLAC/bitwriter.c|   16 ++
 src/libFLAC/ia32/Makefile.am   |2 +-
 src/libFLAC/include/private/macros.h   |6 ++
 src/libFLAC/lpc.c  |   28 
 src/libFLAC/stream_encoder.c   |7 ++
 src/metaflac/Makefile.am   |2 +-
 src/plugin_common/Makefile.am  |2 +-
 src/plugin_xmms/Makefile.am|3 +--
 src/share/getopt/Makefile.am   |2 +-
 src/share/grabbag/Makefile.am  |2 +-
 src/share/replaygain_analysis/Makefile.am  |2 +-
 src/share/replaygain_synthesis/Makefile.am |2 +-
 src/share/utf8/Makefile.am |2 +-
 src/test_grabbag/cuesheet/Makefile.am  |1 +
 src/test_grabbag/picture/Makefile.am   |2 +-
 src/test_libFLAC++/Makefile.am |2 +-
 src/test_libFLAC/Makefile.am   |2 +-
 src/test_libs_common/Makefile.am   |2 +-
 src/test_seeking/Makefile.am   |2 +-
 src/test_streams/Makefile.am   |2 +-
 30 files changed, 68 insertions(+), 86 deletions(-)

diff --git a/configure.ac b/configure.ac
index 7627fb7..e794ca2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,27 +18,18 @@
 # NOTE that for many of the AM_CONDITIONALs we use the prefix FLaC__
 # instead of FLAC__ since autoconf triggers off 'AC_' in strings
 
-AC_INIT(src/flac/main.c)
-AM_INIT_AUTOMAKE(flac, 1.2.1)
+AC_PREREQ(2.60)
+AC_INIT([flac], [1.2.1])
+AC_CONFIG_SRCDIR([src/flac/main.c])
+AC_CONFIG_MACRO_DIR([m4])
+AM_INIT_AUTOMAKE([foreign -Wall tar-pax no-dist-gzip dist-xz subdir-objects])
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
 
 #Prefer whatever the current ISO standard is.
 AC_PROG_CC_STDC
 AC_USE_SYSTEM_EXTENSIONS
-# Enable the generation of shared libraries under Win32
-AC_LIBTOOL_WIN32_DLL
-
-# We need two libtools, one that builds both shared and static, and
-# one that builds only static.  This is because the resulting libtool
-# does not allow us to choose which to build at runtime.
-AM_PROG_LIBTOOL
-sed -e 's/^build_old_libs=yes/build_old_libs=no/' libtool  
libtool-disable-static
-chmod +x libtool-disable-static
-
-AC_SUBST(ACLOCAL_AMFLAGS, -I m4)
-AC_CONFIG_MACRO_DIR([m4])
-
+LT_INIT([win32-dll disable-static pic-only])
 AM_PROG_AS
 AC_PROG_CXX
 AC_PROG_MAKE_SET
@@ -47,7 +38,7 @@ AC_SYS_LARGEFILE
 AC_FUNC_FSEEKO
 
 AC_CHECK_SIZEOF(void*,0)
-
+AC_SEARCH_LIBS([lround],[m], [AC_DEFINE(HAVE_LROUND,1,lround support)])
 #@@@ new name is AC_CONFIG_HEADERS
 AM_CONFIG_HEADER(config.h)
 
@@ -348,18 +339,13 @@ AC_DEFINE(FLAC__HAS_GAS)
 AH_TEMPLATE(FLAC__HAS_GAS, [define if you are compiling for PowerPC and have 
the 'gas' assembler])
 fi
 
-CPPFLAGS='-I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include' 
$CPPFLAGS
 if test x$debug = xtrue; then
-   CPPFLAGS=-DDEBUG -DFLaC__INLINE= $CPPFLAGS
+   CPPFLAGS=-DDEBUG $CPPFLAGS
CFLAGS=-g $CFLAGS
 else
CPPFLAGS=-DNDEBUG $CPPFLAGS
-   # $ac_cv_c_inline from AC_C_INLINE
-   if test x$ac_cv_c_inline != xno ; then
-   CPPFLAGS=-DFLaC__INLINE=$ac_cv_c_inline $CPPFLAGS
-   fi
if test x$GCC = xyes; then
-   CFLAGS=-O3 -funroll-loops -finline-functions -Wall -W -Winline 
$CFLAGS
+CFLAGS=-O3 -funroll-loops -Wall -W -Winline $CFLAGS
fi
 fi
 
diff --git a/examples/c/decode/file/Makefile.am 
b/examples/c/decode/file/Makefile.am
index 11a48bf..30f8691 100644
--- a/examples/c/decode/file/Makefile.am
+++ b/examples/c/decode/file/Makefile.am
@@ -19,7 +19,7 @@ EXTRA_DIST = \
Makefile.lite \
example_c_decode_file.dsp \
example_c_decode_file.vcproj
-
+AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
 noinst_PROGRAMS = example_c_decode_file
 example_c_decode_file_LDADD = \
$(top_builddir)/src/libFLAC/libFLAC.la \
diff --git a/examples/c/encode/file/Makefile.am 
b/examples/c/encode/file/Makefile.am
index 5ae7a63..0ed519a 100644
--- a/examples/c/encode/file/Makefile.am
+++ b/examples/c/encode/file/Makefile.am
@@ -19,7 

Re: [flac-dev] Where is configure

2012-04-09 Thread Cristian Rodríguez
On 09/04/12 22:50, Danpoleary wrote:
 Hello,

 I downloaded the complete src from cvs. and as normal, I try to run
 ./configure, but it does not exist. All the documentation talks about
 it, but it is nowhere to be found.

 Was it removed from src?

no, It is just that autogenerated files do not belong to the development 
repositories.. you have to generate it running autoreconf -fiv

Cheers.
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] Where is configure

2012-04-10 Thread Cristian Rodríguez
El 10/04/12 02:02, Ralph Giles escribió:
 On 9 April 2012 18:50, Danpolearydanpole...@netscape.net  wrote:

 I downloaded the complete src from cvs. and as normal, I try to run
 ./configure, but it does not exist. All the documentation talks about it,
 but it is nowhere to be found.

 Also please be aware that there's newer development at
 https://git.xiph.org/?p=flac.git

 The CVS repository at sourceforge.net hasn't seen updates in some time.


yep. to build from git..

touch config.rpath
autoreconf -fiv

config.rpath  is long standing automake kludge that is not needed to 
build flac.
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] remove src/libFLAC/ia32 permanently?

2012-04-12 Thread Cristian Rodríguez
El 12/04/12 22:55, Ben Allison escribió:
 No.  It is much faster, measurably.  Anyone who believes the old adage that 
 compilers outperform humans isn't writing math code or is just a lousy 
 assembly programmer.

In which system/compiler did you tried it ?



___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH] Remove local_strtoull, windows has equivalent function _strtoui64

2012-04-17 Thread Cristian Rodríguez
---
 include/share/compat.h|8 
 src/flac/main.c   |   37 +
 src/share/grabbag/seektable.c |   31 +--
 3 files changed, 10 insertions(+), 66 deletions(-)

diff --git a/include/share/compat.h b/include/share/compat.h
index e9ac958..ff5c8af 100644
--- a/include/share/compat.h
+++ b/include/share/compat.h
@@ -59,3 +59,11 @@
 #include inttypes.h
 #endif
 
+#if defined(_MSC_VER)
+#define strtoll _strtoi64
+#endif
+
+#if defined(_MSC_VER) 
+#define restrict __restrict
+#endif
+
diff --git a/src/flac/main.c b/src/flac/main.c
index 80af14c..6f24e55 100644
--- a/src/flac/main.c
+++ b/src/flac/main.c
@@ -36,6 +36,7 @@
 #include FLAC/all.h
 #include share/alloc.h
 #include share/grabbag.h
+#include share/compat.h
 #include analyze.h
 #include decode.h
 #include encode.h
@@ -84,11 +85,6 @@ static const char *get_outfilename(const char *infilename, 
const char *suffix);
 static void die(const char *message);
 static int conditional_fclose(FILE *f);
 static char *local_strdup(const char *source);
-#ifdef _MSC_VER
-/* There's no strtoll() in MSVC6 so we just write a specialized one */
-static FLAC__int64 local__strtoll(const char *src, char **endptr);
-#endif
-
 
 /*
  * share__getopt format struct; note that for long options with no
@@ -683,13 +679,8 @@ int parse_option(int short_option, const char 
*long_option, const char *option_a
FLAC__ASSERT(0 != option_argument);
{
char *end;
-#ifdef _MSC_VER
FLAC__int64 i;
-   i = local__strtoll(option_argument, end);
-#else
-   long long i;
i = strtoll(option_argument, end, 10);
-#endif
if(0 == strlen(option_argument) || *end)
return usage_error(ERROR: --%s must be 
a number\n, long_option);
option_values.format_input_size = (off_t)i;
@@ -,29 +2213,3 @@ char *local_strdup(const char *source)
die(out of memory during strdup());
return ret;
 }
-
-#ifdef _MSC_VER
-/* There's no strtoll() in MSVC6 so we just write a specialized one */
-FLAC__int64 local__strtoll(const char *src, char **endptr)
-{
-   FLAC__bool neg = false;
-   FLAC__int64 ret = 0;
-   int c;
-   FLAC__ASSERT(0 != src);
-   if(*src == '-') {
-   neg = true;
-   src++;
-   }
-   while(0 != (c = *src)) {
-   c -= '0';
-   if(c = 0  c = 9)
-   ret = (ret * 10) + c;
-   else
-   break;
-   src++;
-   }
-   if(endptr)
-   *endptr = (char*)src;
-   return neg? -ret : ret;
-}
-#endif
diff --git a/src/share/grabbag/seektable.c b/src/share/grabbag/seektable.c
index fe33084..831e525 100644
--- a/src/share/grabbag/seektable.c
+++ b/src/share/grabbag/seektable.c
@@ -21,36 +21,11 @@
 #endif
 
 #include share/grabbag.h
+#include share/compat.h
 #include FLAC/assert.h
 #include stdlib.h /* for atoi() */
 #include string.h
 
-#ifdef _MSC_VER
-/* There's no strtoll() in MSVC6 so we just write a specialized one */
-static FLAC__int64 local__strtoll(const char *src, char **endptr)
-{
-   FLAC__bool neg = false;
-   FLAC__int64 ret = 0;
-   int c;
-   FLAC__ASSERT(0 != src);
-   if(*src == '-') {
-   neg = true;
-   src++;
-   }
-   while(0 != (c = *src)) {
-   c -= '0';
-   if(c = 0  c = 9)
-   ret = (ret * 10) + c;
-   else
-   break;
-   src++;
-   }
-   if(endptr)
-   *endptr = (char*)src;
-   return neg? -ret : ret;
-}
-#endif
-
 FLAC__bool grabbag__seektable_convert_specification_to_template(const char 
*spec, FLAC__bool only_explicit_placeholders, FLAC__uint64 
total_samples_to_encode, unsigned sample_rate, FLAC__StreamMetadata 
*seektable_template, FLAC__bool *spec_has_real_points)
 {
unsigned i;
@@ -107,11 +82,7 @@ FLAC__bool 
grabbag__seektable_convert_specification_to_template(const char *spec
*spec_has_real_points = true;
if(!only_explicit_placeholders) {
char *endptr;
-#ifdef _MSC_VER
-   const FLAC__int64 n = 
local__strtoll(pt, endptr);
-#else
const FLAC__int64 n = 
(FLAC__int64)strtoll(pt, endptr, 10);
-#endif
if(
(n  0 || (endptr  pt  
*endptr == ';'))  /* is a valid number (extra check needed for 0) */
(total_samples_to_encode == 0 
|| (FLAC__uint64)n 

[flac-dev] [PATCH 2/2] replace local_strtoull with _strtoui64 in windows

2012-04-17 Thread Cristian Rodríguez
Previous patch replaced the other local_strtoll with _strtoi64
---
 include/share/compat.h |3 ++-
 src/metaflac/options.c |   23 +--
 2 files changed, 3 insertions(+), 23 deletions(-)

diff --git a/include/share/compat.h b/include/share/compat.h
index ff5c8af..8ad3698 100644
--- a/include/share/compat.h
+++ b/include/share/compat.h
@@ -61,9 +61,10 @@
 
 #if defined(_MSC_VER)
 #define strtoll _strtoi64
+#define strtoull _strtoui64
 #endif
 
-#if defined(_MSC_VER) 
+#if defined(_MSC_VER)
 #define restrict __restrict
 #endif
 
diff --git a/src/metaflac/options.c b/src/metaflac/options.c
index 43e1f6c..0f227da 100644
--- a/src/metaflac/options.c
+++ b/src/metaflac/options.c
@@ -25,6 +25,7 @@
 #include utils.h
 #include FLAC/assert.h
 #include share/alloc.h
+#include share/compat.h
 #include share/grabbag/replaygain.h
 #include ctype.h
 #include stdio.h
@@ -840,34 +841,12 @@ FLAC__bool parse_uint32(const char *src, FLAC__uint32 
*dest)
return true;
 }
 
-#ifdef _MSC_VER
-/* There's no strtoull() in MSVC6 so we just write a specialized one */
-static FLAC__uint64 local__strtoull(const char *src)
-{
-   FLAC__uint64 ret = 0;
-   int c;
-   FLAC__ASSERT(0 != src);
-   while(0 != (c = *src++)) {
-   c -= '0';
-   if(c = 0  c = 9)
-   ret = (ret * 10) + c;
-   else
-   break;
-   }
-   return ret;
-}
-#endif
-
 FLAC__bool parse_uint64(const char *src, FLAC__uint64 *dest)
 {
FLAC__ASSERT(0 != src);
if(strlen(src) == 0 || strspn(src, 0123456789) != strlen(src))
return false;
-#ifdef _MSC_VER
-   *dest = local__strtoull(src);
-#else
*dest = strtoull(src, 0, 10);
-#endif
return true;
 }
 
-- 
1.7.7

___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH 3/3] export MALLOC_PERTURB_ and MALLOC_CHECK_ in test suite

2012-04-17 Thread Cristian Rodríguez
That enables an special implementation that checks
for common memory errors and will save us from a lot pain.
---
 test/test_bins.sh  |2 ++
 test/test_flac.sh  |2 ++
 test/test_grabbag.sh   |2 ++
 test/test_libFLAC++.sh |2 ++
 test/test_libFLAC.sh   |3 +++
 test/test_metaflac.sh  |2 ++
 test/test_seeking.sh   |2 ++
 test/test_streams.sh   |2 ++
 8 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/test/test_bins.sh b/test/test_bins.sh
index 55a0b8a..9b1fa0f 100755
--- a/test/test_bins.sh
+++ b/test/test_bins.sh
@@ -37,6 +37,8 @@ 
LD_LIBRARY_PATH=../src/share/replaygain_synthesis/.libs:$LD_LIBRARY_PATH
 LD_LIBRARY_PATH=../src/share/utf8/.libs:$LD_LIBRARY_PATH
 LD_LIBRARY_PATH=../obj/$BUILD/lib:$LD_LIBRARY_PATH
 export LD_LIBRARY_PATH
+export MALLOC_CHECK_=3
+export MALLOC_PERTURB_==$(($RANDOM % 255 + 1))
 PATH=../src/flac:$PATH
 PATH=../obj/$BUILD/bin:$PATH
 BINS_PATH=../../test_files/bins
diff --git a/test/test_flac.sh b/test/test_flac.sh
index 0aa7e61..7e4a8fd 100755
--- a/test/test_flac.sh
+++ b/test/test_flac.sh
@@ -51,6 +51,8 @@ 
LD_LIBRARY_PATH=`pwd`/../src/share/replaygain_synthesis/.libs:$LD_LIBRARY_PATH
 LD_LIBRARY_PATH=`pwd`/../src/share/utf8/.libs:$LD_LIBRARY_PATH
 LD_LIBRARY_PATH=`pwd`/../obj/$BUILD/lib:$LD_LIBRARY_PATH
 export LD_LIBRARY_PATH
+export MALLOC_CHECK_=3
+export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
 PATH=`pwd`/../src/flac:$PATH
 PATH=`pwd`/../src/metaflac:$PATH
 PATH=`pwd`/../src/test_streams:$PATH
diff --git a/test/test_grabbag.sh b/test/test_grabbag.sh
index 5c044b3..8f1c5c9 100755
--- a/test/test_grabbag.sh
+++ b/test/test_grabbag.sh
@@ -34,6 +34,8 @@ LD_LIBRARY_PATH=../src/share/grabbag/.libs:$LD_LIBRARY_PATH
 LD_LIBRARY_PATH=../src/share/replaygain_analysis/.libs:$LD_LIBRARY_PATH
 LD_LIBRARY_PATH=../obj/$BUILD/lib:$LD_LIBRARY_PATH
 export LD_LIBRARY_PATH
+export MALLOC_CHECK_=3
+export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
 PATH=../src/test_grabbag/cuesheet:$PATH
 PATH=../src/test_grabbag/picture:$PATH
 PATH=../obj/$BUILD/bin:$PATH
diff --git a/test/test_libFLAC++.sh b/test/test_libFLAC++.sh
index a5e32a5..18ddd53 100755
--- a/test/test_libFLAC++.sh
+++ b/test/test_libFLAC++.sh
@@ -35,6 +35,8 @@ LD_LIBRARY_PATH=../src/share/grabbag/.libs:$LD_LIBRARY_PATH
 LD_LIBRARY_PATH=../src/share/replaygain_analysis/.libs:$LD_LIBRARY_PATH
 LD_LIBRARY_PATH=../obj/$BUILD/lib:$LD_LIBRARY_PATH
 export LD_LIBRARY_PATH
+export MALLOC_CHECK_=3
+export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
 PATH=../src/test_libFLAC++:$PATH
 PATH=../obj/$BUILD/bin:$PATH
 
diff --git a/test/test_libFLAC.sh b/test/test_libFLAC.sh
index 21ed6bf..067b4e1 100755
--- a/test/test_libFLAC.sh
+++ b/test/test_libFLAC.sh
@@ -34,6 +34,9 @@ LD_LIBRARY_PATH=../src/share/grabbag/.libs:$LD_LIBRARY_PATH
 LD_LIBRARY_PATH=../src/share/replaygain_analysis/.libs:$LD_LIBRARY_PATH
 LD_LIBRARY_PATH=../obj/$BUILD/lib:$LD_LIBRARY_PATH
 export LD_LIBRARY_PATH
+export MALLOC_CHECK_=3
+export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
+
 PATH=../src/test_libFLAC:$PATH
 PATH=../obj/$BUILD/bin:$PATH
 
diff --git a/test/test_metaflac.sh b/test/test_metaflac.sh
index c823ccf..3cc9a8e 100755
--- a/test/test_metaflac.sh
+++ b/test/test_metaflac.sh
@@ -46,6 +46,8 @@ 
LD_LIBRARY_PATH=`pwd`/../src/share/replaygain_synthesis/.libs:$LD_LIBRARY_PATH
 LD_LIBRARY_PATH=`pwd`/../src/share/utf8/.libs:$LD_LIBRARY_PATH
 LD_LIBRARY_PATH=`pwd`/../obj/$BUILD/lib:$LD_LIBRARY_PATH
 export LD_LIBRARY_PATH
+export MALLOC_CHECK_=3
+export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
 PATH=`pwd`/../src/flac:$PATH
 PATH=`pwd`/../src/metaflac:$PATH
 PATH=`pwd`/../obj/$BUILD/bin:$PATH
diff --git a/test/test_seeking.sh b/test/test_seeking.sh
index 94e4de1..86e828b 100755
--- a/test/test_seeking.sh
+++ b/test/test_seeking.sh
@@ -32,6 +32,8 @@ fi
 LD_LIBRARY_PATH=../src/libFLAC/.libs:$LD_LIBRARY_PATH
 LD_LIBRARY_PATH=../obj/$BUILD/lib:$LD_LIBRARY_PATH
 export LD_LIBRARY_PATH
+export MALLOC_CHECK_=3
+export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
 PATH=../src/flac:$PATH
 PATH=../src/metaflac:$PATH
 PATH=../src/test_seeking:$PATH
diff --git a/test/test_streams.sh b/test/test_streams.sh
index 14c1a12..b5680c4 100755
--- a/test/test_streams.sh
+++ b/test/test_streams.sh
@@ -31,6 +31,8 @@ fi
 
 LD_LIBRARY_PATH=../obj/$BUILD/lib:$LD_LIBRARY_PATH
 export LD_LIBRARY_PATH
+export MALLOC_CHECK_=3
+export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
 PATH=../src/flac:$PATH
 PATH=../src/test_streams:$PATH
 PATH=../obj/$BUILD/bin:$PATH
-- 
1.7.7

___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH 3/3] export MALLOC_PERTURB_ and MALLOC_CHECK_ in test suite

2012-04-18 Thread Cristian Rodríguez
On 18/04/12 09:08, Erik de Castro Lopo wrote:
 Cristian Rodríguez wrote:

 That enables an special implementation that checks
 for common memory errors and will save us from a lot pain.
 ---
   test/test_bins.sh  |2 ++
   test/test_flac.sh  |2 ++
   test/test_grabbag.sh   |2 ++
   test/test_libFLAC++.sh |2 ++
   test/test_libFLAC.sh   |3 +++
   test/test_metaflac.sh  |2 ++
   test/test_seeking.sh   |2 ++
   test/test_streams.sh   |2 ++
   8 files changed, 17 insertions(+), 0 deletions(-)

 diff --git a/test/test_bins.sh b/test/test_bins.sh
 index 55a0b8a..9b1fa0f 100755
 --- a/test/test_bins.sh
 +++ b/test/test_bins.sh
 @@ -37,6 +37,8 @@ 
 LD_LIBRARY_PATH=../src/share/replaygain_synthesis/.libs:$LD_LIBRARY_PATH
   LD_LIBRARY_PATH=../src/share/utf8/.libs:$LD_LIBRARY_PATH
   LD_LIBRARY_PATH=../obj/$BUILD/lib:$LD_LIBRARY_PATH
   export LD_LIBRARY_PATH
 +export MALLOC_CHECK_=3
 +export MALLOC_PERTURB_==$(($RANDOM % 255 + 1))

 This has problems.

 This fails in bash, sh and dash. Eg bash:

  $ echo $(($RANDON % 256))
  bash: % 256: syntax error: operand expected (error token is % 256)

 I do howver like this idea it if can be made to work



works for me in zsh, bash..etc.. there is a typo in the quoted line though.

export MALLOC_PERTURB_==$(($RANDOM % 255 + 1))

must say

export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))


however is not gonna work with dash.

___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [Flac-dev] Git branch with compiling fixes for win32

2012-05-04 Thread Cristian Rodríguez
El 03/05/12 12:19, Miroslav Lichvar escribió:
 Hi Josh,

 nice to see you here again.

 On Wed, Apr 25, 2012 at 04:26:05PM -0700, Josh Coalson wrote:
 (Jumping in again, maybe at the wrong point since this doesn't seem
 to involve encoding, but here goes.)

 Miroslav's patches have always been high-quality for sure.  But
 regardless of submitter, any patch that affects encoding must be
 reviewed very carefully, preferably by several other people and
 definitely me.  If there were ever a libFLAC release that had a bug
 and was not always lossless, that would be very damaging to the
 format.

 The bitreader patch touches only the rice decoding code which I
 believe is very well covered by the test suite and any bugs would be
 quickly seen. Also, it has also been included in the Fedora packages
 for several years, no bug reports about MD5 mismatch were received
 yet :).

 It makes the C function faster than the corresponding asm routine, so
 if it's included I'd suggest to just drop the asm function to not keep
 around more asm code than is necessary.

 I'm not sure if anyone is planning to port the asm code to x86_64, I
 think that it will be quite a lot of work, perhaps it would be a good
 time to reconsider using inline assembly instead of nasm to minimize
 the amount of asm code? It would be useful to know how much are the
 individual asm routines actually faster, it has been a long time
 since I played with it.


Hi:

Both Erick and I did already submitted patches to the tree that do just 
exactly what your flac-1.2.1-bitreader.patch intended.. please checkout 
current GIT tree.

Cheers!

___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [Flac-dev] Git branch with compiling fixes for win32

2012-05-04 Thread Cristian Rodríguez
El 03/05/12 12:19, Miroslav Lichvar escribió:


 It makes the C function faster than the corresponding asm routine, so
 if it's included I'd suggest to just drop the asm function to not keep
 around more asm code than is necessary.

With current compilers it is very likely that those routines are already 
superflous.
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [Flac-dev] Git branch with compiling fixes for win32

2012-05-04 Thread Cristian Rodríguez
El 04/05/12 11:53, Miroslav Lichvar escribió:
 On Fri, May 04, 2012 at 11:13:05AM -0400, Cristian Rodríguez wrote:
 Both Erick and I did already submitted patches to the tree that do just
 exactly what your flac-1.2.1-bitreader.patch intended.. please checkout
 current GIT tree.

 The most interesting part of the patch is the rewrite of the
 FLAC__bitreader_read_rice_signed_block function, which in the git repo
 seems to have only couple lines changed since 1.2.1.

Ah ok, I will check it out !


 BTW, how much faster is the code with the clz builtin? If the
 architecture doesn't have the instruction, will be the gcc code as
 fast as the original code?

I do not have access to a host that does not have either bsr, clz, 
lzcnt, cntlz or ctlz. if you do, plz share your results ;)

I have no idea what code will be generated in exotic archs, in x86 it 
translates to bsr ^ 31U and in the others supported to a single instruction.



___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [Flac-dev] Git branch with compiling fixes for win32

2012-05-04 Thread Cristian Rodríguez
El 04/05/12 12:09, Miroslav Lichvar escribió:
 On Fri, May 04, 2012 at 05:53:23PM +0200, Miroslav Lichvar wrote:
 The most interesting part of the patch is the rewrite of the
 FLAC__bitreader_read_rice_signed_block function, which in the git repo
 seems to have only couple lines changed since 1.2.1.

 Here is that part of the patch rebased against current git. In a quick
 test it gives a 10% speedup in decoding.


Looking at the openSUSE trees, we carry this patch since Aug 2011 and 
have recieved no reports on it being broken, also it works fine in my 
machine ;)


___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH] Optionally, allow distros to use openssl for MD5 verification

2012-05-05 Thread Cristian Rodríguez
This has the advantage of being more efficient than the included
routines and allows distros to centralize crypto mainteniance on
a few libraries.
---
 configure.ac  |4 +-
 m4/ax_check_openssl.m4|  124 +
 src/libFLAC/Makefile.am   |2 +-
 src/libFLAC/include/private/md5.h |8 ++-
 src/libFLAC/md5.c |   38 +++
 src/libFLAC/stream_decoder.c  |   30 +++--
 src/libFLAC/stream_encoder.c  |   30 +++--
 7 files changed, 220 insertions(+), 16 deletions(-)
 create mode 100644 m4/ax_check_openssl.m4

diff --git a/configure.ac b/configure.ac
index e794ca2..3b627e5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -56,7 +56,7 @@ AM_PROG_CC_C_O
 AC_C_INLINE
 AC_C_VARARRAYS
 AC_C_TYPEOF
-
+AC_FUNC_ALLOCA
 AC_CHECK_HEADERS(stdint.h)
 AC_SUBST(HAVE_STDINT_H)
 AC_CHECK_HEADERS(inttypes.h)
@@ -83,6 +83,8 @@ dnl check for getopt in standard library
 dnl AC_CHECK_FUNCS(getopt_long , , [LIBOBJS=$LIBOBJS getopt.o getopt1.o] )
 AC_CHECK_FUNCS(getopt_long, [], [])
 
+AX_CHECK_OPENSSL([AC_DEFINE([HAVE_OPENSSL], [1], [We have openSSL])])
+
 case $host_cpu in
i*86)
cpu_ia32=true
diff --git a/m4/ax_check_openssl.m4 b/m4/ax_check_openssl.m4
new file mode 100644
index 000..a87c5a6
--- /dev/null
+++ b/m4/ax_check_openssl.m4
@@ -0,0 +1,124 @@
+# ===
+# http://www.gnu.org/software/autoconf-archive/ax_check_openssl.html
+# ===
+#
+# SYNOPSIS
+#
+#   AX_CHECK_OPENSSL([action-if-found[, action-if-not-found]])
+#
+# DESCRIPTION
+#
+#   Look for OpenSSL in a number of default spots, or in a user-selected
+#   spot (via --with-openssl).  Sets
+#
+# OPENSSL_INCLUDES to the include directives required
+# OPENSSL_LIBS to the -l directives required
+# OPENSSL_LDFLAGS to the -L or -R flags required
+#
+#   and calls ACTION-IF-FOUND or ACTION-IF-NOT-FOUND appropriately
+#
+#   This macro sets OPENSSL_INCLUDES such that source files should use the
+#   openssl/ directory in include directives:
+#
+# #include openssl/hmac.h
+#
+# LICENSE
+#
+#   Copyright (c) 2009,2010 Zmanda Inc. http://www.zmanda.com/
+#   Copyright (c) 2009,2010 Dustin J. Mitchell dus...@zmanda.com
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+#serial 8
+
+AU_ALIAS([CHECK_SSL], [AX_CHECK_OPENSSL])
+AC_DEFUN([AX_CHECK_OPENSSL], [
+found=false
+AC_ARG_WITH([openssl],
+[AS_HELP_STRING([--with-openssl=DIR],
+[root of the OpenSSL directory])],
+[
+case $withval in
+ | y | ye | yes | n | no)
+AC_MSG_ERROR([Invalid --with-openssl value])
+  ;;
+*) ssldirs=$withval
+  ;;
+esac
+], [
+# if pkg-config is installed and openssl has installed a .pc file,
+# then use that information and don't search ssldirs
+AC_PATH_PROG([PKG_CONFIG], [pkg-config])
+if test x$PKG_CONFIG != x; then
+OPENSSL_LDFLAGS=`$PKG_CONFIG openssl --libs-only-L 2/dev/null`
+if test $? = 0; then
+OPENSSL_LIBS=`$PKG_CONFIG openssl --libs-only-l 
2/dev/null`
+OPENSSL_INCLUDES=`$PKG_CONFIG openssl --cflags-only-I 
2/dev/null`
+found=true
+fi
+fi
+
+# no such luck; use some default ssldirs
+if ! $found; then
+ssldirs=/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg 
/usr/local /usr
+fi
+]
+)
+
+
+# note that we #include openssl/foo.h, so the OpenSSL headers have to be 
in
+# an 'openssl' subdirectory
+
+if ! $found; then
+OPENSSL_INCLUDES=
+for ssldir in $ssldirs; do
+AC_MSG_CHECKING([for openssl/ssl.h in $ssldir])
+if test -f $ssldir/include/openssl/ssl.h; then
+OPENSSL_INCLUDES=-I$ssldir/include
+OPENSSL_LDFLAGS=-L$ssldir/lib
+OPENSSL_LIBS=-lssl -lcrypto
+found=true
+AC_MSG_RESULT([yes])
+break
+else
+AC_MSG_RESULT([no])
+fi
+done
+
+# if the file wasn't found, well, go ahead and try the link anyway -- 
maybe
+# it will just work!
+fi
+
+# try the preprocessor and linker with our new flags,
+# being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS
+
+AC_MSG_CHECKING([whether compiling and linking against OpenSSL works])
+echo Trying link with OPENSSL_LDFLAGS=$OPENSSL_LDFLAGS; \
+OPENSSL_LIBS=$OPENSSL_LIBS; 

Re: [flac-dev] [PATCH] Add missing functions to SeekTable class

2012-05-06 Thread Cristian Rodríguez
El 06/05/12 19:18, Josh Coalson escribió:
 From: Cristian Rodríguezcrrodrig...@opensuse.org

 Sent: Sunday, May 6, 2012 8:24 AM

 El 05/05/12 02:23, Bastiaan Timmer escribió:
   The attached patch adds the missing FLAC__metadata_object_seektable_*()
 functions from FLAC's metadata object methods (FLAC/metadata.h) to
 FLAC++'s SeekTable class. Of the 11 functions in the C API, only 4 are
 currently in the C++ API, this patch adds the missing 7.

   If this patch is ok, VorbisComment will be next. A quick look tells me 
 only
 5 out of 13 FLAC__metadata_object_vorbiscomment*() functions from
 FLAC/metadata.h exist in FLAC++'s VorbisComment class.

   Bas Timmer

 This patch looks fine to me.. if applied we either need to raise the C++
 library SOVERSION and/or add a linker versioning script for *nix systems
 though.

 Looks good to me to.  Erik, are you keeping up with patches?  Lately I've only
 been able to follow along.

 The soname is a good point: the flac release numbers are tied to the format
 and I rely on the sonames to manage binary compatibility.  Some maintainers
 don't like it but I think it's important for users:
 http://flac.sourceforge.net/faq.html#api__release_versioning

Yes, The soname change is an annoyance for distributions but if there is 
no linker version script it is the only possible way to get package 
managers to do the right thing on updates/upgrades.


___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [Flac-dev] Git branch with compiling fixes for win32

2012-05-07 Thread Cristian Rodríguez
El 07/05/12 13:37, Miroslav Lichvar escribió:
 On Mon, May 07, 2012 at 09:19:52PM +0400, LRN wrote:
 In a test on a Core 2 machine with gcc-4.6.3, i686 flac build with
 nasm enabled is about 7% faster in decoding than without nasm.
 x86_64 build is about 2% faster than the i686 build with nasm
 enabled.

 Was that with -O2 or -O3?

 Not sure, I didn't set CFLAGS which seems to result in using both:
 -O3 -funroll-loops -Wall -W -Winline -g -O2

 I think funroll-loops can be harmful, the Fedora package is compiled
 with -O2 and funroll-loops is used only for the stream_encoder file
 and it seems decoding is a tiny bit faster than with the git version.
 Unfortunately I don't recall the details.

 On Mon, May 07, 2012 at 01:23:03PM -0400, Cristian Rodríguez wrote:
 Did you build with -fprofile-generate ... then make check .. then
 rebuild with -fprofile-use ?

 No, I have not tried that.


Yes, -funroll-loops might cause code growth and/or make binaries 
actually slower...

BTW, just wondering, how are you measuring the speed in this tests ? I 
would be interested to know so I can reproduce it here with different 
compile/link options
___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH] Optionally, allow distros to use openssl for MD5 verification

2012-05-07 Thread Cristian Rodríguez
El 07/05/12 16:19, Eric Wong escribió:

 flac and metaflac do not use openSSL, only libFLAC does.

 But since flac/metaflac use libFLAC, I suspect (IANAL) the relationship
 can be transitive.  (But being an optional dependency helps as distros
 can avoid potential issues).

That's why it is optional, however there is no such issue, all this 
incompatibility thing arised of interpretations by debian and the FSF, 
as far as the rest of the world. openSSL falls into the category of a 
system library, twhich falls into the special exception clause which 
allows your GPL-ed program to link against GPL incompatible libraries 
which are shipped as part of the operating system.

 OpenSSL doesn't have a good track record as far as ABI/API stability is
 concerned (though I think the hash APIs are more stable).

Those  compiling and linking against incompatible library versions are 
doing it wrong, usually happends when users dont get proper packages 
from distributions or distributor-provided backports.



___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] [PATCH] Add missing functions to VorbisComment class + a few other things

2012-05-07 Thread Cristian Rodríguez
El 07/05/12 17:02, Bastiaan Timmer escribió:
 Attached is a patch that adds 5 missing FLAC__metadata_object_vorbiscomment_* 
 functions to the VorbisComment class. In my previous message I stated 8 
 functions were missing, but on closer inspection, 3 of those belong in the 
 VorbisComment::Entry class, and 2 of them already have equivalent functions 
 in there. The last one (FLAC__metadata_object_vorbiscomment_entry_matches()) 
 does not, but I have not done that one (yet).

 Looking at the FLAC__metadata_object_cuesheet_* 
 FLAC__metadata_object_picture_* functions, it looks like the corresponding 
 FLAC++ classes are already complete. Maybe some functions are missing from 
 CueSheet::Track. If nobody objects, I will take a look later this week.

 Also, I've noticed that on my system, flac will not compile with 
 --enable-debug, because some functions that use 'PRId64' get compiled in, but 
 no included header defines 'PRId64'. I have not written a patch because I'm 
 not sure whether this is just my weird system (fairly standard Fedora 
 installation) or all gcc users or all *NIX users. However, should a fix be 
 necessary: PRId64 is defined in inttypes.h which can be included in line 43 
 of src/libFLAC/lpo.c (after the '#if defined DEBUG') to solve this on my 
 system.

 Lastly, the reason I tried to compile with debug was some invalid read sizes 
 reported by valgrind when creating a VorbisComment::Entry. The invalid read 
 is reported in set_field_name() at line 653 (src/libFLAC++/metadata.cpp), 
 where strlen() is used on the newly created char *field_name_. I could not 
 see anything wrong with the code though, and strangely enough just calling 
 printf on the field_name_ 1 line before the strlen() removes all valgrind 
 errors. So I'm not sure what's going on, but it's probably a bug in valgrind, 
 maybe somebody on this list knows?


While you are at it, can you check/fix the following warning ?

metadata.cpp:812:98: warning: narrowing conversion of 'strlen(((const 
char*)string))' from 'size_t {aka long unsigned int}' to 'FLAC__uint32 
{aka unsigned int}' inside { } is ill-formed in C++11 [-Wnarrowing]


Thanks !

___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH 2/2] bitmath: Finish up optimizations

2012-05-08 Thread Cristian Rodríguez
This patch adds support for other compilers and systems
including MSVC, Intel C compiler etc..
---
 src/libFLAC/bitmath.c |   48 -
 src/libFLAC/bitreader.c   |   54 ++-
 src/libFLAC/include/private/bitmath.h |  120 ++---
 3 files changed, 116 insertions(+), 106 deletions(-)

diff --git a/src/libFLAC/bitmath.c b/src/libFLAC/bitmath.c
index 189977c..4fdde4b 100644
--- a/src/libFLAC/bitmath.c
+++ b/src/libFLAC/bitmath.c
@@ -36,54 +36,6 @@
 #include private/bitmath.h
 #include FLAC/assert.h
 
-/* An example of what FLAC__bitmath_ilog2() computes:
- *
- * ilog2( 0) = assertion failure
- * ilog2( 1) = 0
- * ilog2( 2) = 1
- * ilog2( 3) = 1
- * ilog2( 4) = 2
- * ilog2( 5) = 2
- * ilog2( 6) = 2
- * ilog2( 7) = 2
- * ilog2( 8) = 3
- * ilog2( 9) = 3
- * ilog2(10) = 3
- * ilog2(11) = 3
- * ilog2(12) = 3
- * ilog2(13) = 3
- * ilog2(14) = 3
- * ilog2(15) = 3
- * ilog2(16) = 4
- * ilog2(17) = 4
- * ilog2(18) = 4
- */
-
-#ifndef __GNUC__
-
-/* For GNUC, use static inline version in include/private/bitmath.h. */
-
-unsigned FLAC__bitmath_ilog2(FLAC__uint32 v)
-{
-   unsigned l = 0;
-if (v == 0)
-   return 0;
-   while(v = 1)
-   l++;
-   return l;
-}
-
-unsigned FLAC__bitmath_ilog2_wide(FLAC__uint64 v)
-{
-   unsigned l = 0;
-if (v == 0)
-   return 0;
-   while(v = 1)
-   l++;
-   return l;
-}
-#endif
-
 /* An example of what FLAC__bitmath_silog2() computes:
  *
  * silog2(-10) = 5
diff --git a/src/libFLAC/bitreader.c b/src/libFLAC/bitreader.c
index dcd9e42..9e15db0 100644
--- a/src/libFLAC/bitreader.c
+++ b/src/libFLAC/bitreader.c
@@ -43,7 +43,7 @@
 #include share/endswap.h
 
 /* Things should be fastest when this matches the machine word size */
-/* WATCHOUT: if you change this you must also change the following #defines 
down to COUNT_ZERO_MSBS below to match */
+/* WATCHOUT: if you change this you must also change the following #defines 
down to FLAC__clz_uint32 below to match */
 /* WATCHOUT: there are a few places where the code will not work unless 
uint32_t is = 32 bits wide */
 /*   also, some sections currently only have fast versions for 4 or 8 
bytes per word */
 #define FLAC__BYTES_PER_WORD 4 /* sizeof uint32_t */
@@ -56,27 +56,6 @@
 #define SWAP_BE_WORD_TO_HOST(x) ENDSWAP_32(x)
 #endif
 
-#if defined(__GNUC__)
-/*  int __builtin_clz (unsigned int x) If x is 0, the result is undefined */
-static inline uint32_t
-COUNT_ZERO_MSBS (uint32_t word)
-{
-   if (word == 0)
-   return 32;
-   return __builtin_clz (word);
-}
-#else
-/* counts the # of zero MSBs in a word */
-#define COUNT_ZERO_MSBS(word) ( \
-   (word)  0xff ? byte_to_unary_table[(word)  24] : \
-   !(word) ? 32 : \
-   (word)  0x ? byte_to_unary_table[(word)  16] + 8 : \
-   (word)  0xff ? byte_to_unary_table[(word)  8] + 16 : \
-   byte_to_unary_table[(word)] + 24 \
-)
-#endif
-
-
 /*
  * This should be at least twice as large as the largest number of words
  * required to represent any 'number' (in any encoding) you are going to
@@ -93,25 +72,6 @@ COUNT_ZERO_MSBS (uint32_t word)
  */
 static const unsigned FLAC__BITREADER_DEFAULT_CAPACITY = 65536u / 
FLAC__BITS_PER_WORD; /* in words */
 
-static const unsigned char byte_to_unary_table[] = {
-   8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4,
-   3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
-   2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
-   2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
-   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-};
-
 /* adjust for compilers that can't understand using LLU suffix for uint64_t 
literals */
 #ifdef _MSC_VER
 #define FLAC__U64L(x) x
@@ -679,7 +639,7 @@ FLAC__bool 
FLAC__bitreader_read_unary_unsigned(FLAC__BitReader *br, unsigned *va
while(br-consumed_words  br-words) { /* if we've not 
consumed up to a partial tail word... */
uint32_t b = br-buffer[br-consumed_words]  
br-consumed_bits;
if(b) {
-   i = COUNT_ZERO_MSBS(b);
+   i = FLAC__clz_uint32(b);
*val += i;
i++;
br-consumed_bits += i;
@@ 

Re: [flac-dev] Patch for cross compilation with MinGW32

2012-07-01 Thread Cristian Rodríguez
El 23/06/12 22:23, Christoph Terasa escribió:
 Hello,
 
 I had some difficulties compiling the current git (
 http://git.xiph.org/?p=flac.git;a=commit;h=a7e3705d051bafd1cae90f6605287cc1d9f2a18d
 ) using the Ubuntu 12.04 supplied MinGW32 cross compiler:
 
 I configured the FLAC build with --host=i586-mingw32msvc
 --target=i586-mingw32msvc --build=i586-linux but ran into several linker
 problems. Are these options somehow wrong? It worked fine when I
 compiled libogg-0.dll. Anyway, I attached a patch to allow cross
 compilation with MinGW32 on my machine again:
 
 First, I moved the implementation of *safe_malloc_mul_2op_ to alloc.h,
 just like all the other alloc implementations, and removed the thereby
 obsolete alloc.c implementation from grabbag.
 Second, I just wrapped FLAC__clz_soft_uint32 with an #ifndef __MINGW32__.
 
 I tested the patch for both Linux and MinGW32 compiles, and both result
 in functional programs.
 

It works for me.. with mingw32-cross-gcc-4.7.0-8.43.x86_64 and the
resulting binaries also work.


___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] Shared library won't build when cross-compiling.

2012-12-12 Thread Cristian Rodríguez
El 22/08/12 04:03, Nathan Osman escribió:
 I'm having trouble cross-compiling FLAC for Windows from Linux.

 I am using the following commands:

 ./configure --host=i686-w64-mingw32 --prefix=/usr/i686-w64-mingw32
 --enable-shared
 make

 The process completes successfully but I only end up with the static
 library. The following files are copied to the $(PREFIX)/lib directory
 when I run 'make install':

 - libFLAC.a
 - libFLAC++.a
 - libFLAC.la
 - libFLAC++.la

 ...and there aren't any DLLs in the $(PREFIX)/bin directory.


Works for me...

-=-=-=-=-=-=-=-=-=-= Configuration Complete =-=-=-=-=-=-=-=-=-=-

   Configuration summary :

 FLAC version :  1.2.1

 Host CPU :  x86_64
 Host Vendor : . w64
 Host OS : . mingw32

 Compiler is GCC : . yes
 GCC version : . 4.7.0



ls src/libFLAC/.libs/libFLAC-8.dll

-rwxr-xr-x 1 crrodriguez users 1,3M dic 12 21:49 libFLAC-8.dll



What compiler and flac version are you using ?


___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] Commonly getting FLAC__STREAM_ENCODER_VERIFY_MISMATCH_IN_AUDIO_DATA on valid audio

2013-02-07 Thread Cristian Rodríguez
El 07/02/13 19:07, Collin escribió:
 I'm using libflac on Windows to compress some audio samples. I'm building the
 library locally, using Visual Studio 2010. Each set of data is 2-5 MB and well
 formed PCM encoded data. I'm finding some very odd behavior.

 If I enable verify on the encode stream, I get a verify mismatch on most of my
 sample sets. Each set of samples returns this error at a different location in
 the stream, but always the same location for the same file.

 However, if I disable verify, the resulting FLAC encoded data DOES decode
 correctly in most cases, giving me an exact replica of the input.

Before debugging further, ensure you can reproduce this in a different 
computer, or verify that you dont have broken RAM.


___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] flac 1.3.0pre1 prelease

2013-03-02 Thread Cristian Rodríguez
El 02/03/13 20:22, Erik de Castro Lopo escribió:
 Hi all,

 I finally managed to bite the bullet and roll a pre-release. Its
 here:

  http://downloads.xiph.org/releases/flac/beta/

 I have personally tested this code on:

  x86-linux
  x86_64-linux
  powerpc-linux



armv7 little endian hard float.
ppc64
ppc
(linux)
all test passes.


___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] 2GB limit patch

2013-03-04 Thread Cristian Rodríguez
On 03/04/2013 10:57 PM, nu774 wrote:
 This is an older issue reported in 2007:
 http://lists.xiph.org/pipermail/flac-dev/2007-September/002423.html

 The fix would be to use _ftelli64 instead of ftell with Visual Studio.
 http://msdn.microsoft.com/en-us/library/0ys3hc0b%28v=vs.110%29.aspx

 That's not enough. At least, the followings are also needed.

 1. Change off_t to something else. off_t can lead to ABI issue when used
 in public API, since it's definition can change even on the same system
 (by setting _FILE_OFFSET_BITS or something), and is always 32bit on
 mingw, mingw-w64 and MSVC.
 Since FLAC even takes the trouble of casting seek offset to off_t when
 calling fseeko(), it gets truncated to 32bit on Win32 even if you use
 _fseeki64().
 This change results in ABI break, but luckily it seems there's only one
 metadata function that uses off_t in public API.

 2. i686-pc-mingw also needs fseeko()/ftello() definitions (only
 fseeko64() and ftello64() available).

 3. stat()/fstat() must be also taken care of, when it is used to get
 file size.

 4. In some place, size of off_t is checked to see if FLAC binary is
 compiled with large file support. These also need modification.


 I have made a fork on https://github.com/nu774/FLAC including these
 patches, but it's not tested enough.
 Erik already knows at least off_t issue, and he said he'd like to fix it
 in the future. It needs many lines of change (although it basically is a
 trivial replacement).

Nothing against you code, that's ugly ..but as it is a first step it can 
be forgiven :-)

I will just force flac to be built with 64 bit file offsets and just 
reject any caller trying to include/link libflac into a non-lfs program 
like

http://ac-archive.sourceforge.net/largefile/off_t_headers.html

Then we can fix all the internal problems, without the need of 
typedef'ing around ;)





___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] flac 1.3.0pre1 prelease

2013-03-04 Thread Cristian Rodríguez
On 03/04/2013 07:36 PM, Erik de Castro Lopo wrote:
 Martijn van Beurden wrote:

 'chown', declared with attribute warn_unused_result [-Wunused-result]
 metadata_iterators.c:3299:2: warning: ignoring return value of
 'chown', declared with attribute warn_unused_result [-Wunused-result]
 In file included from /usr/include/stdio.h:934:0,

 Thats an Ubuntu special.

Nope, it is standard linux system nowdays.

They have patched their libc headers and compilers
 to catch these.

Nope. they just build with fortify_source by default ;)





___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] Fwd: flac 1.3.0pre1 prelease

2013-03-04 Thread Cristian Rodríguez
On 03/05/2013 03:32 AM, Erik de Castro Lopo wrote:

 May look at CMake after this current release.

That will make the situation reverse, that is, better for windows, 
insane for the rest of the world.


___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] Real-world tests (commit 300d17c)

2013-03-13 Thread Cristian Rodríguez
El 13/03/13 10:50, Martijn van Beurden escribió:
 but
 decompression is about 15% faster.

Cool, just wondering though.. it says The machine used for running the 
test has an Intel Core2Duo T9600 with 4GB of RAM and is using Kubuntu 
12.10.  .. is the OS in 64 bit mode ? which CFLAGS where used and what 
compiler ?

___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH] Ensure AM_LDFLAGS is used consistently

2013-04-18 Thread Cristian Rodríguez
---
 src/libFLAC++/Makefile.am | 2 +-
 src/libFLAC/Makefile.am   | 2 +-
 src/metaflac/Makefile.am  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/libFLAC++/Makefile.am b/src/libFLAC++/Makefile.am
index 6bd1657..12dfe69 100644
--- a/src/libFLAC++/Makefile.am
+++ b/src/libFLAC++/Makefile.am
@@ -44,7 +44,7 @@ EXTRA_DIST = \
libFLAC++.m4
 
 # see 
'http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning' 
for numbering convention
-libFLAC___la_LDFLAGS = -version-info 9:0:3 @LT_NO_UNDEFINED@
+libFLAC___la_LDFLAGS = $(AM_LDFLAGS) -version-info 9:0:3 @LT_NO_UNDEFINED@
 libFLAC___la_LIBADD = ../libFLAC/libFLAC.la
 
 libFLAC___la_SOURCES = \
diff --git a/src/libFLAC/Makefile.am b/src/libFLAC/Makefile.am
index aa0b8b6..84eadb9 100644
--- a/src/libFLAC/Makefile.am
+++ b/src/libFLAC/Makefile.am
@@ -112,7 +112,7 @@ extra_ogg_sources = \
 endif
 
 # see 
'http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning' 
for numbering convention
-libFLAC_la_LDFLAGS = -version-info 11:0:3 $(LOCAL_EXTRA_LDFLAGS) 
@LT_NO_UNDEFINED@
+libFLAC_la_LDFLAGS = $(AM_LDFLAGS) -version-info 11:0:3 $(LOCAL_EXTRA_LDFLAGS) 
@LT_NO_UNDEFINED@
 
 libFLAC_sources = \
bitmath.c \
diff --git a/src/metaflac/Makefile.am b/src/metaflac/Makefile.am
index bd54356..35460b1 100644
--- a/src/metaflac/Makefile.am
+++ b/src/metaflac/Makefile.am
@@ -39,7 +39,7 @@ metaflac_SOURCES = \
options.h \
usage.h \
utils.h
-metaflac_LDFLAGS =
+metaflac_LDFLAGS = $(AM_LDFLAGS)
 
 metaflac_LDADD = \
$(top_builddir)/src/share/grabbag/libgrabbag.la \
-- 
1.8.1.4

___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


Re: [flac-dev] (no subject)

2013-05-01 Thread Cristian Rodríguez
On 05/01/2013 06:47 PM, Marcus Johnson wrote:
 One last thing, Xcode complains about the .nasm files when compiling for
 x64, I don't know too much about assembly, can x86 assembly be compiled
 on x64 at all?

the assembly code in flac in x86_32 only.

___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[flac-dev] [PATCH] Add missing config.h includes

2013-05-31 Thread Cristian Rodríguez
All C and C++ files must include config.h
---
 src/libFLAC++/metadata.cpp | 4 
 src/libFLAC++/stream_decoder.cpp   | 4 
 src/libFLAC++/stream_encoder.cpp   | 4 
 src/plugin_xmms/charset.c  | 4 
 src/plugin_xmms/configure.c| 4 
 src/plugin_xmms/fileinfo.c | 4 
 src/plugin_xmms/http.c | 4 
 src/plugin_xmms/plugin.c   | 4 
 src/plugin_xmms/tag.c  | 4 
 src/share/grabbag/alloc.c  | 4 
 src/test_libFLAC++/encoders.cpp| 4 
 src/test_libFLAC++/main.cpp| 4 
 src/test_libFLAC++/metadata.cpp| 4 
 src/test_libFLAC++/metadata_object.cpp | 4 
 src/utils/flactimer/main.cpp   | 4 
 15 files changed, 60 insertions(+)

diff --git a/src/libFLAC++/metadata.cpp b/src/libFLAC++/metadata.cpp
index e03acf3..d6fff06 100644
--- a/src/libFLAC++/metadata.cpp
+++ b/src/libFLAC++/metadata.cpp
@@ -31,6 +31,10 @@
  */
 
 #define __STDC_LIMIT_MACROS 1 /* otherwise SIZE_MAX is not defined for c++ */
+#ifdef HAVE_CONFIG_H
+#include config.h
+#endif
+
 #include share/alloc.h
 #include FLAC++/metadata.h
 #include FLAC/assert.h
diff --git a/src/libFLAC++/stream_decoder.cpp b/src/libFLAC++/stream_decoder.cpp
index 5d68c28..73c5608 100644
--- a/src/libFLAC++/stream_decoder.cpp
+++ b/src/libFLAC++/stream_decoder.cpp
@@ -30,6 +30,10 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#ifdef HAVE_CONFIG_H
+#include config.h
+#endif
+
 #include FLAC++/decoder.h
 #include FLAC/assert.h
 
diff --git a/src/libFLAC++/stream_encoder.cpp b/src/libFLAC++/stream_encoder.cpp
index eff..a19ec6e 100644
--- a/src/libFLAC++/stream_encoder.cpp
+++ b/src/libFLAC++/stream_encoder.cpp
@@ -30,6 +30,10 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#ifdef HAVE_CONFIG_H
+#include config.h
+#endif
+
 #include FLAC++/encoder.h
 #include FLAC++/metadata.h
 #include FLAC/assert.h
diff --git a/src/plugin_xmms/charset.c b/src/plugin_xmms/charset.c
index 2c5167f..6d86848 100644
--- a/src/plugin_xmms/charset.c
+++ b/src/plugin_xmms/charset.c
@@ -20,6 +20,10 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
+#ifdef HAVE_CONFIG_H
+#include config.h
+#endif
+
 #include plugin.h
 
 #include stdlib.h
diff --git a/src/plugin_xmms/configure.c b/src/plugin_xmms/configure.c
index 6b83435..3dfddc4 100644
--- a/src/plugin_xmms/configure.c
+++ b/src/plugin_xmms/configure.c
@@ -21,6 +21,10 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
+#ifdef HAVE_CONFIG_H
+#include config.h
+#endif
+
 #include plugin.h
 
 #include stdlib.h
diff --git a/src/plugin_xmms/fileinfo.c b/src/plugin_xmms/fileinfo.c
index e5e5fb1..54c0c56 100644
--- a/src/plugin_xmms/fileinfo.c
+++ b/src/plugin_xmms/fileinfo.c
@@ -18,6 +18,10 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  */
 
+#ifdef HAVE_CONFIG_H
+#include config.h
+#endif
+
 #include plugin.h
 
 #include stdlib.h
diff --git a/src/plugin_xmms/http.c b/src/plugin_xmms/http.c
index c51f1b8..2f31576 100644
--- a/src/plugin_xmms/http.c
+++ b/src/plugin_xmms/http.c
@@ -17,6 +17,10 @@
  */
 /* modified for FLAC support by Steven Richman (2003) */
 
+#ifdef HAVE_CONFIG_H
+#include config.h
+#endif
+
 #include plugin.h
 
 #include sys/types.h
diff --git a/src/plugin_xmms/plugin.c b/src/plugin_xmms/plugin.c
index c99b52e..50a109f 100644
--- a/src/plugin_xmms/plugin.c
+++ b/src/plugin_xmms/plugin.c
@@ -17,6 +17,10 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
+#ifdef HAVE_CONFIG_H
+#include config.h
+#endif
+
 #include plugin.h
 
 #include limits.h
diff --git a/src/plugin_xmms/tag.c b/src/plugin_xmms/tag.c
index 19e20ba..6f0f68c 100644
--- a/src/plugin_xmms/tag.c
+++ b/src/plugin_xmms/tag.c
@@ -20,6 +20,10 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
+#ifdef HAVE_CONFIG_H
+#include config.h
+#endif
+
 #include plugin.h
 
 #include stdlib.h
diff --git a/src/share/grabbag/alloc.c b/src/share/grabbag/alloc.c
index f514bd7..80f099e 100644
--- a/src/share/grabbag/alloc.c
+++ b/src/share/grabbag/alloc.c
@@ -30,6 +30,10 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#ifdef HAVE_CONFIG_H
+#include config.h
+#endif
+
 #include stdlib.h
 
 #include share/alloc.h
diff --git a/src/test_libFLAC++/encoders.cpp b/src/test_libFLAC++/encoders.cpp
index 309d7af..98b4685 100644
--- a/src/test_libFLAC++/encoders.cpp
+++ b/src/test_libFLAC++/encoders.cpp
@@ -17,6 +17,10 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
+#ifdef HAVE_CONFIG_H
+#include config.h
+#endif
+
 #include encoders.h
 #include FLAC/assert.h
 #include FLAC++/encoder.h
diff --git a/src/test_libFLAC++/main.cpp b/src/test_libFLAC++/main.cpp
index 78301b2..9932773 100644
--- a/src/test_libFLAC++/main.cpp
+++ b/src/test_libFLAC++/main.cpp
@@ -17,6 +17,10 @@
  * 51 

[flac-dev] [PATCH] Link with -no-undefined regardless of the OS

2013-07-20 Thread Cristian Rodríguez
libFLAC* must never have undefined symbols no matter
what is the target platform.
---
 configure.ac  | 10 +-
 src/libFLAC++/Makefile.am |  2 +-
 src/libFLAC/Makefile.am   |  2 +-
 3 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/configure.ac b/configure.ac
index 50ef80e..ba46caf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -129,19 +129,11 @@ AM_CONDITIONAL(FLaC__CPU_PPC_SPE, test x$abi_spe = 
xtrue)
 os_is_windows=no
 case $host in
*-*-cygwin|*mingw*)
-   # define this variable for enabling strict exports with 
libtool; for now, it's supported by Win32 and OS/2
-   LT_NO_UNDEFINED=-no-undefined
CPPFLAGS=-D__MSVCRT_VERSION__=0x0601 $CPPFLAGS
os_is_windows=yes
;;
-   *emx*)
-   LT_NO_UNDEFINED=-no-undefined
-   ;;
-   *)
-   LT_NO_UNDEFINED=
-   ;;
 esac
-AC_SUBST(LT_NO_UNDEFINED)
+
 AM_CONDITIONAL(OS_IS_WINDOWS, test x$os_is_windows = xyes)
 
 case $host in
diff --git a/src/libFLAC++/Makefile.am b/src/libFLAC++/Makefile.am
index 51b8cf8..b84f3e4 100644
--- a/src/libFLAC++/Makefile.am
+++ b/src/libFLAC++/Makefile.am
@@ -45,7 +45,7 @@ EXTRA_DIST = \
libFLAC++.m4
 
 # see 
'http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning' 
for numbering convention
-libFLAC___la_LDFLAGS = $(AM_LDFLAGS) -version-info 9:0:3 @LT_NO_UNDEFINED@
+libFLAC___la_LDFLAGS = $(AM_LDFLAGS) -no-undefined -version-info 9:0:3
 libFLAC___la_LIBADD = ../libFLAC/libFLAC.la
 
 libFLAC___la_SOURCES = \
diff --git a/src/libFLAC/Makefile.am b/src/libFLAC/Makefile.am
index 86155ab..939f706 100644
--- a/src/libFLAC/Makefile.am
+++ b/src/libFLAC/Makefile.am
@@ -113,7 +113,7 @@ extra_ogg_sources = \
 endif
 
 # see 
'http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning' 
for numbering convention
-libFLAC_la_LDFLAGS = $(AM_LDFLAGS) -version-info 11:0:3 $(LOCAL_EXTRA_LDFLAGS) 
@LT_NO_UNDEFINED@
+libFLAC_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined -version-info 11:0:3 
$(LOCAL_EXTRA_LDFLAGS)
 
 libFLAC_sources = \
bitmath.c \
-- 
1.8.3.1

___
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev