From 63dd4b45983babdf1703b320526aed48a87ca45e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 4 Dec 2006 04:45:50 +0000 Subject: Add OggFLAC support when using the new 1.1.3 FLAC library This means that when using libFLAC as a shared object, OggFLAC support is dependent on the compile-time options of the libFLAC library loaded. git-svn-id: https://svn.musicpd.org/mpd/trunk@5112 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/inputPlugins/_flac_common.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/inputPlugins/_flac_common.h') diff --git a/src/inputPlugins/_flac_common.h b/src/inputPlugins/_flac_common.h index eab7971e5..2dd5517e5 100644 --- a/src/inputPlugins/_flac_common.h +++ b/src/inputPlugins/_flac_common.h @@ -36,6 +36,8 @@ # define flac_decoder FLAC__SeekableStreamDecoder # define flac_new(x) FLAC__seekable_stream_decoder_new(x) +# define flac_ogg_init(a,b,c,d,e,f,g,h,i,j) (0) + # define flac_get_decode_position(x,y) \ FLAC__seekable_stream_decoder_get_decode_position(x,y) # define flac_get_state(x) FLAC__seekable_stream_decoder_get_state(x) @@ -78,18 +80,26 @@ # include # endif #else /* FLAC_API_VERSION_CURRENT >= 7 */ - /* OggFLAC support is handled by our flac_plugin already */ -# ifdef HAVE_OGGFLAC -# undef HAVE_OGGFLAC + + /* OggFLAC support is handled by our flac_plugin already, and + * thus we *can* always have it if libFLAC was compiled with it */ +# ifndef HAVE_OGGFLAC +# define HAVE_OGGFLAC 1 # endif -# include # include "_ogg_common.h" +# undef HAVE_OGGFLAC /* we don't need this defined anymore */ + +# include # define flac_decoder FLAC__StreamDecoder # define flac_new(x) FLAC__stream_decoder_new(x) # define flac_init(a,b,c,d,e,f,g,h,i,j) \ (FLAC__stream_decoder_init_stream(a,b,c,d,e,f,g,h,i,j) \ == FLAC__STREAM_DECODER_INIT_STATUS_OK) +# define flac_ogg_init(a,b,c,d,e,f,g,h,i,j) \ + (FLAC__stream_decoder_init_ogg_stream(a,b,c,d,e,f,g,h,i,j) \ + == FLAC__STREAM_DECODER_INIT_STATUS_OK) + # define flac_get_decode_position(x,y) \ FLAC__stream_decoder_get_decode_position(x,y) # define flac_get_state(x) FLAC__stream_decoder_get_state(x) -- cgit v1.2.3