From kde-multimedia Tue Dec 18 16:10:53 2007 From: Alex Merry Date: Tue, 18 Dec 2007 16:10:53 +0000 To: kde-multimedia Subject: FLAC 1.1.3+ support Message-Id: <200712181610.59855.huntedhacker () tiscali ! co ! uk> X-MARC-Message: https://marc.info/?l=kde-multimedia&m=119806833708186 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============0968837594==" --===============0968837594== Content-Type: multipart/signed; boundary="nextPart2304475.du06LmOaJR"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart2304475.du06LmOaJR Content-Type: multipart/mixed; boundary="Boundary-01=_NE/ZHkPMISphhov" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_NE/ZHkPMISphhov Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline The audiocd kioslave FLAC plugin doesn't currently build with a libFLAC=20 newer that 1.1.2, due to API changes. Given libFLAC is now up to=20 1.2.1, this isn't very good. The attached patch adds support for libFLAC > 1.1.2 (while retaining=20 support for 1.1.2). OK to commit? Alex PS: I'm not subscribed, so please CC me in replies. =2D-=20 KDE: http://www.kde.org Ubuntu/Kubuntu: http://www.ubuntu.org http://www.kubuntu.org --Boundary-01=_NE/ZHkPMISphhov Content-Type: text/x-diff; charset="us-ascii"; name="flac.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="flac.diff" Index: kdelibs/cmake/modules/FindFlac.cmake =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- kdelibs/cmake/modules/FindFlac.cmake (revision 749960) +++ kdelibs/cmake/modules/FindFlac.cmake (working copy) @@ -5,6 +5,9 @@ # FLAC_INCLUDE_DIR - the Flac include directory # FLAC_LIBRARIES - Link these to use Flac # FLAC_OGGFLAC_LIBRARIES - Link these to use OggFlac +# +# No version checking is done - use FLAC_API_VERSION_CURRENT to +# conditionally compile version-dependent code =20 # Copyright (c) 2006, Laurent Montel, # Copyright (c) 2006, Alexander Neundorf, @@ -23,18 +26,16 @@ FIND_LIBRARY(FLAC_LIBRARIES NAMES FLAC ) =20 FIND_LIBRARY(FLAC_OGG_LIBRARY NAMES OggFLAC) =20 =2Dcheck_library_exists(FLAC FLAC__stream_encoder_set_write_callback "" HAV= E_STREAM_ENCODER_WRITE_CALLBACK) =2D =20 =20 =2DIF(FLAC_INCLUDE_DIR AND FLAC_LIBRARIES AND HAVE_STREAM_ENCODER_WRITE_CAL= LBACK) +IF(FLAC_INCLUDE_DIR AND FLAC_LIBRARIES) SET(FLAC_FOUND TRUE) IF (FLAC_OGG_LIBRARY) SET(FLAC_OGGFLAC_LIBRARIES ${FLAC_OGG_LIBRARY} ${FLAC_LIBRARIES}) ENDIF (FLAC_OGG_LIBRARY) =2DELSE(FLAC_INCLUDE_DIR AND FLAC_LIBRARIES AND HAVE_STREAM_ENCODER_WRITE_C= ALLBACK) +ELSE(FLAC_INCLUDE_DIR AND FLAC_LIBRARIES) SET(FLAC_FOUND FALSE) =2DENDIF(FLAC_INCLUDE_DIR AND FLAC_LIBRARIES AND HAVE_STREAM_ENCODER_WRITE_= CALLBACK) +ENDIF(FLAC_INCLUDE_DIR AND FLAC_LIBRARIES) =20 IF(FLAC_FOUND) IF(NOT Flac_FIND_QUIETLY) Index: kdemultimedia/kioslave/audiocd/plugins/flac/encoderflac.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- kdemultimedia/kioslave/audiocd/plugins/flac/encoderflac.cpp (revision= 749997) +++ kdemultimedia/kioslave/audiocd/plugins/flac/encoderflac.cpp (working co= py) @@ -48,7 +48,16 @@ public: unsigned long data; }; =20 =2Dstatic FLAC__StreamEncoderWriteStatus WriteCallback(const FLAC__StreamEn= coder *encoder, const FLAC__byte buffer[], unsigned bytes, unsigned samples= , unsigned current_frame, void *client_data) +static FLAC__StreamEncoderWriteStatus WriteCallback(const FLAC__StreamEnco= der *encoder, + const FLAC__byte buffe= r[], +#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT <=3D 7 + unsigned bytes, +#else + size_t bytes, +#endif + unsigned samples, + unsigned current_frame, + void *client_data) { EncoderFLAC::Private *d =3D (EncoderFLAC::Private*)client_data; =20 @@ -110,9 +119,11 @@ unsigned long EncoderFLAC::size(long tim long EncoderFLAC::readInit(long size) { kDebug(7117) << "EncoderFLAC::readInit() called"; d->data =3D 0; +#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT <=3D 7 FLAC__stream_encoder_set_write_callback(d->encoder, WriteCallback); FLAC__stream_encoder_set_metadata_callback(d->encoder, MetadataCallbac= k); FLAC__stream_encoder_set_client_data(d->encoder, d); +#endif =20 // The options match approximely those of flac compression-level-3 FLAC__stream_encoder_set_do_mid_side_stereo(d->encoder, true); @@ -125,7 +136,11 @@ long EncoderFLAC::readInit(long size) { if (size > 0) FLAC__stream_encoder_set_total_samples_estimate(d->encoder, size/4= ); =20 +#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT <=3D 7 FLAC__stream_encoder_init(d->encoder); +#else + FLAC__stream_encoder_init_stream(d->encoder, WriteCallback, NULL, NULL= , MetadataCallback, d); +#endif return d->data; } =20 --Boundary-01=_NE/ZHkPMISphhov-- --nextPart2304475.du06LmOaJR Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQBHZ/ENBRauKLutZ9ARAtsyAKCkz0u4hLdbVDZik7OCeEi0RqrWtACgyqOx opJHB7ePgUXomrc/e8NZdYI= =Yx58 -----END PGP SIGNATURE----- --nextPart2304475.du06LmOaJR-- --===============0968837594== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kde-multimedia mailing list kde-multimedia@kde.org https://mail.kde.org/mailman/listinfo/kde-multimedia --===============0968837594==--