#22 Correct FLAC inline and fix compiling with Sun Studio

open-fixed
Josh Coalson
None
8
2009-01-03
2007-04-17
Brian Cameron
No

This patch fixes a number of problems with FLAC. Note this bug is a new patch that works with FLAC 1.4.0 and replaces bug 1214424. I couldn't figure out how to update that bug with a new patch.

1) Mainly it fixes flac so it properly tests for inline
in the configure script and consistently uses
FLAC_INLINE everywhere. This properly sets inline
to work on different compilers by using AC_C_INLINE.
Note you need to run autoheader and autoconf after
applying the patch for config.h to have the define
FLAC_INLINE.

2) Fix src/share/replaygain_analysis so it compiles
with Sun Studio. Sun Studio doesn't like floating
points in array values. So I fixed this by changing
RMS_WINDOW_TIME from 0.050 to 50 (so it is specified
in ms rather than s). Then in the two places where
it is referenced I add " / 1000" so it gives the
same value. I think this is cleaner. Plus it works
with more compilers.

3) Note that it was necessary to redefine four things
as extern instead of static. This is because
Sun Studio does not allow you to reference static
elements from within extern inline functions.

bitreader_read_from_client and byte_to_unary_table
in src/libFLAC/bitreader.c
bitwriter_grow_ in src/libFLAC/bitwriter.c
is_big_endian_host_ in src/libFLAC/md5.c.

This was necessary because Sun Studio doesn't
allow you to reference static variables from
extern inline functions.

Also byteSwap in src/libFLAC/md5.c needed to be
more clearly defined as "extern" to make the
linker happy.

4) Sun Studio doesn't like the ^M characters at the
end of each line in
include/share/replaygain_analysis.h, so the
patch removes these.

Discussion

<< < 1 2 (Page 2 of 2)
  • Josh Coalson
    Josh Coalson
    2007-11-07

    Logged In: YES
    user_id=78173
    Originator: NO

    it will eventually get in... I haven't had a lot of free time to work on FLAC lately

     
  • Brian Cameron
    Brian Cameron
    2008-12-08

    *ping* Can this go upstream? This bug report seems to have languished for over a year.

     
  • Josh Coalson
    Josh Coalson
    2009-01-01

    • priority: 6 --> 8
     
  • Josh Coalson
    Josh Coalson
    2009-01-03

    • status: open-accepted --> open-fixed
     
  • Josh Coalson
    Josh Coalson
    2009-01-03

    ok, I checked in fixes for everything I think. can you try with cvs head?

     
<< < 1 2 (Page 2 of 2)