--- kdemultimedia-3.5.5/kioslave/audiocd/configure.in.in 2005-09-10 01:19:49.000000000 -0700 +++ kdemultimedia-3.5.5-b2/kioslave/audiocd/configure.in.in 2006-10-19 14:24:10.000000000 -0700 @@ -5,7 +5,7 @@ have_libFLAC=no KDE_CHECK_HEADER(FLAC/metadata.h, [ - KDE_CHECK_LIB(FLAC,FLAC__seekable_stream_decoder_process_single, + KDE_CHECK_LIB(FLAC,FLAC__stream_decoder_process_single, have_libFLAC=yes) ]) --- kdemultimedia-3.5.5/kioslave/audiocd/plugins/flac/encoderflac.cpp 2006-01-19 08:40:33.000000000 -0800 +++ kdemultimedia-3.5.5-b2/kioslave/audiocd/plugins/flac/encoderflac.cpp 2006-10-19 14:36:32.000000000 -0700 @@ -29,6 +29,11 @@ #include #include +#if !defined FLAC_API_VERSION_CURRENT || FLAC_API_VERSION_CURRENT < 8 +#define LEGACY_FLAC +#else +#undef LEGACY_FLAC +#endif extern "C" { @@ -47,7 +52,11 @@ unsigned long data; }; +#ifdef LEGACY_FLAC static FLAC__StreamEncoderWriteStatus WriteCallback(const FLAC__StreamEncoder *encoder, const FLAC__byte buffer[], unsigned bytes, unsigned samples, unsigned current_frame, void *client_data) +#else +static FLAC__StreamEncoderWriteStatus WriteCallback(const FLAC__StreamEncoder *encoder, const FLAC__byte buffer[], size_t bytes, unsigned samples, unsigned current_frame, void *client_data) +#endif { EncoderFLAC::Private *d = (EncoderFLAC::Private*)client_data; @@ -109,9 +118,11 @@ long EncoderFLAC::readInit(long size) { kdDebug(7117) << "EncoderFLAC::readInit() called"<< endl; d->data = 0; +#ifdef LEGACY_FLAC FLAC__stream_encoder_set_write_callback(d->encoder, WriteCallback); FLAC__stream_encoder_set_metadata_callback(d->encoder, MetadataCallback); FLAC__stream_encoder_set_client_data(d->encoder, d); +#endif // The options match approximely those of flac compression-level-3 FLAC__stream_encoder_set_do_mid_side_stereo(d->encoder, true); @@ -124,7 +135,13 @@ if (size > 0) FLAC__stream_encoder_set_total_samples_estimate(d->encoder, size/4); - FLAC__stream_encoder_init(d->encoder); +#ifdef LEGACY_FLAC + if(FLAC__stream_encoder_init(d->encoder) != FLAC__STREAM_ENCODER_OK) + ; // really should handle an init failure +#else + if(FLAC__stream_encoder_init_stream(d->encoder, WriteCallback, NULL, NULL, MetadataCallback, d) != FLAC__STREAM_ENCODER_INIT_STATUS_OK) + ; // really should handle an init failure +#endif return d->data; }