PDA

View Full Version : libFLAC 1.2.1 update for PAPlayer


azertypete
2007-11-20, 22:07
Hello Guys,

As you maybe know a new version of the libFLAC (http://flac.sourceforge.net/changelog.html#flac_1_2_1) is out and fixes Some Vulnerabilities. (http://research.eeye.com/html/advisories/published/AD20071115.html)

I was wondering were I could get the patched source code of the libFLAC.dll 1.1.4 that is already in the SVN, so I could apply the change to the 1.2.1 tree to make it work in XBMC.

Thanks!

jmarshall
2007-11-20, 23:19
From docs/libFLAC.txt in SVN:


XBMC uses the default libFLAC.dll from the win32 developer archive from flac.sourceforge.net

The current version is 1.1.4, and the sources may be downloaded here:

http://downloads.sourceforge.net/flac/flac-1.1.4.tar.gz

The current binary dll is found in the archive available here:

http://downloads.sourceforge.net/flac/flac-1.1.4-devel-win.zip


Simply replacing with the v1.2.1 may be enough, assuming they haven't altered the interface.

azertypete
2007-11-29, 21:44
I tried the win32 libFLAC.dll (v1.2.1) file from the package on sourceforge: Failed (cannot play flac files anymore).

Dll loading error or something. Sorry I don't have the Log file handy.
Weird cause, the FLAC releaselog do not mention any API change (only addition).
Should I build it myself from the source ?

Gamester17
2007-11-30, 10:54
You could try, see http://xboxmediacenter.com/wiki/index.php?title=HOW-TO:_Debug_Dynamic_Link_Libraries

Microsoft Visual Studio C++ compiler, i think all PAPlayer DLLs are compiled with it ???

kurdtkobain
2007-12-07, 08:59
Porting from FLAC 1.1.4 to 1.2.0
[Porting Guide for New Versions]
There were only very minor changes to the interfaces from 1.1.4 to 1.2.0. In libFLAC, FLAC__format_sample_rate_is_subset() was added. In libFLAC++, FLAC::Decoder::Stream::get_decode_position() was added.

Finally, value of the constant FLAC__FRAME_HEADER_RESERVED_LEN has changed to reflect the conversion of one of the reserved bits into active use. It used to be 2 and now is 1. However the FLAC frame header length has not changed, so to skip the proper number of bits, use FLAC__FRAME_HEADER_RESERVED_LEN + FLAC__FRAME_HEADER_BLOCKING_STRATEGY_LEN

there was a minor change in 1.2.0 (http://flac.sourceforge.net/api/group__porting__1__1__4__to__1__2__0.html)

Gamester17
2007-12-07, 14:48
http://xboxmediacenter.com/wiki/index.php?title=HOW-TO_submit_a_patch

:;):

kurdtkobain
2007-12-08, 15:30
i find it kinda pointless to make a patch for one line of code

in format.h in trunk/XBMC/xbmc/cores/paplayer/flac/

add extern FLAC_API const unsigned FLAC__FRAME_HEADER_BLOCKING_STRATEGY_LEN;/**< == 1 (bits) */between lines 430 extern FLAC_API const unsigned FLAC__FRAME_HEADER_BLOCK_SIZE_LEN; /**< == 4 (bits) */ and 431 extern FLAC_API const unsigned FLAC__FRAME_HEADER_SAMPLE_RATE_LEN; /**< == 4 (bits) */i did this and libflac 1.2.0-devel dll worked fine for me.
since in 1.2.1 no more interfaces where changed this could make it work

tested on a 1.6 xbox with an X3 chip

jmarshall
2007-12-09, 02:33
It's updated to v1.21 in SVN. Thanks.