--- libtunepimp-0.4.4.orig/plugins/flac/flacdecode.cpp 2006-10-13 23:06:46 +0300 +++ libtunepimp-0.4.4.orig/plugins/flac/flacdecode.cpp 2007-01-16 00:19:15 +0200 @@ -28,6 +28,14 @@ #include #include "flacdecode.h" +#include +/* FLAC 1.1.3 has FLAC_API_VERSION_CURRENT == 8 */ +#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT < 8 +#define LEGACY_FLAC +#else +#undef LEGACY_FLAC +#endif + void FLAC_errorcb(const FLAC__StreamDecoder * decoder, FLAC__StreamDecoderErrorStatus status, void *client_data) { @@ -99,7 +107,11 @@ FLAC__StreamDecoderReadStatus FLAC_readcb(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], +#ifdef LEGACY_FLAC unsigned *bytes, +#else + size_t *bytes, +#endif void *client_data) { clientdata_t *cd = reinterpret_cast < clientdata_t * >(client_data); @@ -131,6 +143,7 @@ if (!cd.in) return; +#ifdef LEGACY_FLAC if (!FLAC__stream_decoder_set_read_callback(decoder, &FLAC_readcb)) return; @@ -149,6 +162,10 @@ state = FLAC__stream_decoder_init(decoder); if (state != FLAC__STREAM_DECODER_SEARCH_FOR_METADATA) return; +#else + if (FLAC__stream_decoder_init_stream(decoder, &FLAC_readcb, NULL, NULL, NULL, NULL, &FLAC_writecb, &FLAC_metadatacb, &FLAC_errorcb, &cd) != FLAC__STREAM_DECODER_INIT_STATUS_OK) + return; +#endif FLAC__stream_decoder_process_until_end_of_metadata(decoder); state = FLAC__stream_decoder_get_state(decoder); --- libtunepimp-0.4.4.orig/plugins/flac/flacdecode.h 2006-10-13 23:06:46 +0300 +++ libtunepimp-0.4.4.orig/plugins/flac/flacdecode.h 2007-01-16 00:19:15 +0200 @@ -24,10 +24,10 @@ $Id: flacdecode.h 1393 2005-06-15 01:08:20Z robert $ ----------------------------------------------------------------------------*/ -#ifndef __VORBIS_DECODE_H -#define __VORBIS_DECODE_H +#ifndef __FLAC_DECODE_H +#define __FLAC_DECODE_H -#include +#include #include #include "decode_plugin.h" #include "fileio.h"