aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputPlugins/_flac_common.h
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2006-12-04 04:45:50 +0000
committerEric Wong <normalperson@yhbt.net>2006-12-04 04:45:50 +0000
commit63dd4b45983babdf1703b320526aed48a87ca45e (patch)
tree8411ff44b12dacd12dbf453c93b6f38c42bab6fd /src/inputPlugins/_flac_common.h
parentb152086ae4af7c1f4f6e0b92fab3670f59a9e221 (diff)
downloadmpd-63dd4b45983babdf1703b320526aed48a87ca45e.tar.gz
mpd-63dd4b45983babdf1703b320526aed48a87ca45e.tar.xz
mpd-63dd4b45983babdf1703b320526aed48a87ca45e.zip
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
Diffstat (limited to 'src/inputPlugins/_flac_common.h')
-rw-r--r--src/inputPlugins/_flac_common.h18
1 files changed, 14 insertions, 4 deletions
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 <OggFLAC/seekable_stream_decoder.h>
# 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 <FLAC/stream_decoder.h>
# include "_ogg_common.h"
+# undef HAVE_OGGFLAC /* we don't need this defined anymore */
+
+# include <FLAC/stream_decoder.h>
# 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)