diff options
author | Max Kellermann <max@duempel.org> | 2008-10-17 21:57:09 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-10-17 21:57:09 +0200 |
commit | 4ee8da2e694d29efef5f6311d3bf8504d474918f (patch) | |
tree | 868dc1a01c18db170e4259b450263fa507e5504f /src/inputPlugins | |
parent | 25b5d90e448146b6efaf4926680e35aee4a0af6c (diff) | |
download | mpd-4ee8da2e694d29efef5f6311d3bf8504d474918f.tar.gz mpd-4ee8da2e694d29efef5f6311d3bf8504d474918f.tar.xz mpd-4ee8da2e694d29efef5f6311d3bf8504d474918f.zip |
Makefile.am: don't compile disabled decoder plugins
Don't compile the sources of disabled decoder plugins at all, and
don't attempt to register these.
Diffstat (limited to 'src/inputPlugins')
-rw-r--r-- | src/inputPlugins/_flac_common.c | 7 | ||||
-rw-r--r-- | src/inputPlugins/_flac_common.h | 4 | ||||
-rw-r--r-- | src/inputPlugins/_ogg_common.c | 8 | ||||
-rw-r--r-- | src/inputPlugins/_ogg_common.h | 5 | ||||
-rw-r--r-- | src/inputPlugins/aac_plugin.c | 8 | ||||
-rw-r--r-- | src/inputPlugins/audiofile_plugin.c | 9 | ||||
-rw-r--r-- | src/inputPlugins/flac_plugin.c | 49 | ||||
-rw-r--r-- | src/inputPlugins/mod_plugin.c | 9 | ||||
-rw-r--r-- | src/inputPlugins/mp3_plugin.c | 14 | ||||
-rw-r--r-- | src/inputPlugins/mp4_plugin.c | 9 | ||||
-rw-r--r-- | src/inputPlugins/mpc_plugin.c | 9 | ||||
-rw-r--r-- | src/inputPlugins/oggflac_plugin.c | 9 | ||||
-rw-r--r-- | src/inputPlugins/oggvorbis_plugin.c | 11 | ||||
-rw-r--r-- | src/inputPlugins/wavpack_plugin.c | 9 |
14 files changed, 17 insertions, 143 deletions
diff --git a/src/inputPlugins/_flac_common.c b/src/inputPlugins/_flac_common.c index f24e20531..db43e0003 100644 --- a/src/inputPlugins/_flac_common.c +++ b/src/inputPlugins/_flac_common.c @@ -19,12 +19,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../decoder_api.h" - -#if defined(HAVE_FLAC) || defined(HAVE_OGGFLAC) - #include "_flac_common.h" - #include "../log.h" #include <FLAC/format.h> @@ -326,5 +321,3 @@ flac_common_write(FlacData *data, const FLAC__Frame * frame, return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; } - -#endif /* HAVE_FLAC || HAVE_OGGFLAC */ diff --git a/src/inputPlugins/_flac_common.h b/src/inputPlugins/_flac_common.h index e05824147..45714b4bd 100644 --- a/src/inputPlugins/_flac_common.h +++ b/src/inputPlugins/_flac_common.h @@ -24,8 +24,6 @@ #include "../decoder_api.h" -#if defined(HAVE_FLAC) || defined(HAVE_OGGFLAC) - #include <FLAC/export.h> #if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT <= 7 # include <FLAC/seekable_stream_decoder.h> @@ -167,6 +165,4 @@ FLAC__StreamDecoderWriteStatus flac_common_write(FlacData *data, const FLAC__Frame * frame, const FLAC__int32 *const buf[]); -#endif /* HAVE_FLAC || HAVE_OGGFLAC */ - #endif /* _FLAC_COMMON_H */ diff --git a/src/inputPlugins/_ogg_common.c b/src/inputPlugins/_ogg_common.c index 535b9a9dc..841b2ad3f 100644 --- a/src/inputPlugins/_ogg_common.c +++ b/src/inputPlugins/_ogg_common.c @@ -19,12 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "_flac_common.h" #include "_ogg_common.h" - -#if defined(HAVE_OGGFLAC) || defined(HAVE_OGGVORBIS) || \ - (defined(FLAC_API_VERSION_CURRENT) && FLAC_API_VERSION_CURRENT > 7) - +#include "_flac_common.h" #include "../utils.h" ogg_stream_type ogg_stream_type_detect(InputStream * inStream) @@ -51,5 +47,3 @@ ogg_stream_type ogg_stream_type_detect(InputStream * inStream) } return VORBIS; } - -#endif /* defined(HAVE_OGGFLAC || defined(HAVE_OGGVORBIS) */ diff --git a/src/inputPlugins/_ogg_common.h b/src/inputPlugins/_ogg_common.h index 3382e2860..7c9e7b630 100644 --- a/src/inputPlugins/_ogg_common.h +++ b/src/inputPlugins/_ogg_common.h @@ -24,13 +24,8 @@ #include "../decoder_api.h" -#if defined(HAVE_OGGFLAC) || defined(HAVE_OGGVORBIS) || \ - (defined(FLAC_API_VERSION_CURRENT) && FLAC_API_VERSION_CURRENT > 7) - typedef enum _ogg_stream_type { VORBIS, FLAC } ogg_stream_type; ogg_stream_type ogg_stream_type_detect(InputStream * inStream); -#endif /* defined(HAVE_OGGFLAC || defined(HAVE_OGGVORBIS) */ - #endif /* _OGG_COMMON_H */ diff --git a/src/inputPlugins/aac_plugin.c b/src/inputPlugins/aac_plugin.c index e9b2d7476..7842bcc22 100644 --- a/src/inputPlugins/aac_plugin.c +++ b/src/inputPlugins/aac_plugin.c @@ -18,8 +18,6 @@ #include "../decoder_api.h" -#ifdef HAVE_FAAD - #define AAC_MAX_CHANNELS 6 #include "../utils.h" @@ -602,9 +600,3 @@ struct decoder_plugin aacPlugin = { .suffixes = aac_suffixes, .mime_types = aac_mimeTypes }; - -#else - -struct decoder_plugin aacPlugin; - -#endif /* HAVE_FAAD */ diff --git a/src/inputPlugins/audiofile_plugin.c b/src/inputPlugins/audiofile_plugin.c index 4c08074c4..99846e853 100644 --- a/src/inputPlugins/audiofile_plugin.c +++ b/src/inputPlugins/audiofile_plugin.c @@ -19,9 +19,6 @@ */ #include "../decoder_api.h" - -#ifdef HAVE_AUDIOFILE - #include "../log.h" #include <sys/stat.h> @@ -148,9 +145,3 @@ struct decoder_plugin audiofilePlugin = { .stream_types = INPUT_PLUGIN_STREAM_FILE, .suffixes = audiofileSuffixes, }; - -#else - -struct decoder_plugin audiofilePlugin; - -#endif /* HAVE_AUDIOFILE */ diff --git a/src/inputPlugins/flac_plugin.c b/src/inputPlugins/flac_plugin.c index 2f3ec88d9..7b9fce27d 100644 --- a/src/inputPlugins/flac_plugin.c +++ b/src/inputPlugins/flac_plugin.c @@ -17,9 +17,6 @@ */ #include "_flac_common.h" - -#ifdef HAVE_FLAC - #include "../utils.h" #include "../log.h" @@ -386,12 +383,8 @@ static int flac_decode(struct decoder * decoder, InputStream * inStream) return flac_decode_internal(decoder, inStream, 0); } -#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT <= 7 -# define flac_plugin_init NULL -#else /* FLAC_API_VERSION_CURRENT >= 7 */ -/* some of this stuff is duplicated from oggflac_plugin.c */ -extern struct decoder_plugin oggflacPlugin; - +#if defined(FLAC_API_VERSION_CURRENT) && FLAC_API_VERSION_CURRENT > 7 && \ + !defined(HAVE_OGGFLAC) static struct tag *oggflac_tag_dup(char *file) { struct tag *ret = NULL; @@ -429,7 +422,8 @@ static int oggflac_decode(struct decoder *decoder, InputStream * inStream) static bool oggflac_try_decode(InputStream * inStream) { - return ogg_stream_type_detect(inStream) == FLAC; + return FLAC_API_SUPPORTS_OGG_FLAC && + ogg_stream_type_detect(inStream) == FLAC; } static const char *oggflac_suffixes[] = { "ogg", "oga", NULL }; @@ -438,25 +432,15 @@ static const char *oggflac_mime_types[] = { "audio/x-flac+ogg", "application/x-ogg", NULL }; -static int flac_plugin_init(void) -{ - if (!FLAC_API_SUPPORTS_OGG_FLAC) { - DEBUG("libFLAC does not support OggFLAC\n"); - return 1; - } - DEBUG("libFLAC supports OggFLAC, initializing OggFLAC support\n"); - assert(oggflacPlugin.name == NULL); - oggflacPlugin.name = "oggflac"; - oggflacPlugin.try_decode = oggflac_try_decode; - oggflacPlugin.stream_decode = oggflac_decode; - oggflacPlugin.tag_dup = oggflac_tag_dup; - oggflacPlugin.stream_types = INPUT_PLUGIN_STREAM_URL | - INPUT_PLUGIN_STREAM_FILE; - oggflacPlugin.suffixes = oggflac_suffixes; - oggflacPlugin.mime_types = oggflac_mime_types; - decoder_plugin_register(&oggflacPlugin); - return 1; -} +struct decoder_plugin oggflacPlugin = { + .name = "oggflac", + .try_decode = oggflac_try_decode, + .stream_decode = oggflac_decode, + .tag_dup = oggflac_tag_dup, + .stream_types = INPUT_PLUGIN_STREAM_URL | INPUT_PLUGIN_STREAM_FILE, + .suffixes = oggflac_suffixes, + .mime_types = oggflac_mime_types +}; #endif /* FLAC_API_VERSION_CURRENT >= 7 */ @@ -467,16 +451,9 @@ static const char *flac_mime_types[] = { "audio/x-flac", struct decoder_plugin flacPlugin = { .name = "flac", - .init = flac_plugin_init, .stream_decode = flac_decode, .tag_dup = flacTagDup, .stream_types = INPUT_PLUGIN_STREAM_URL | INPUT_PLUGIN_STREAM_FILE, .suffixes = flacSuffixes, .mime_types = flac_mime_types }; - -#else /* !HAVE_FLAC */ - -struct decoder_plugin flacPlugin; - -#endif /* HAVE_FLAC */ diff --git a/src/inputPlugins/mod_plugin.c b/src/inputPlugins/mod_plugin.c index 98bd67f0f..5916a24ab 100644 --- a/src/inputPlugins/mod_plugin.c +++ b/src/inputPlugins/mod_plugin.c @@ -17,9 +17,6 @@ */ #include "../decoder_api.h" - -#ifdef HAVE_MIKMOD - #include "../utils.h" #include "../log.h" @@ -279,9 +276,3 @@ struct decoder_plugin modPlugin = { .stream_types = INPUT_PLUGIN_STREAM_FILE, .suffixes = modSuffixes, }; - -#else - -struct decoder_plugin modPlugin; - -#endif /* HAVE_MIKMOD */ diff --git a/src/inputPlugins/mp3_plugin.c b/src/inputPlugins/mp3_plugin.c index 13e4a4619..18eddf017 100644 --- a/src/inputPlugins/mp3_plugin.c +++ b/src/inputPlugins/mp3_plugin.c @@ -17,8 +17,9 @@ */ #include "../decoder_api.h" - -#ifdef HAVE_MAD +#include "../log.h" +#include "../utils.h" +#include "../conf.h" #include <mad.h> @@ -26,10 +27,6 @@ #include <id3tag.h> #endif -#include "../log.h" -#include "../utils.h" -#include "../conf.h" - #define FRAMES_CUSHION 2000 #define READ_BUFFER_SIZE 40960 @@ -1125,8 +1122,3 @@ struct decoder_plugin mp3Plugin = { .suffixes = mp3_suffixes, .mime_types = mp3_mimeTypes }; -#else - -struct decoder_plugin mp3Plugin; - -#endif /* HAVE_MAD */ diff --git a/src/inputPlugins/mp4_plugin.c b/src/inputPlugins/mp4_plugin.c index 0e152c3a6..1a8268e40 100644 --- a/src/inputPlugins/mp4_plugin.c +++ b/src/inputPlugins/mp4_plugin.c @@ -17,9 +17,6 @@ */ #include "../decoder_api.h" - -#ifdef HAVE_FAAD - #include "../utils.h" #include "../log.h" @@ -424,9 +421,3 @@ struct decoder_plugin mp4Plugin = { .suffixes = mp4_suffixes, .mime_types = mp4_mimeTypes, }; - -#else - -struct decoder_plugin mp4Plugin; - -#endif /* HAVE_FAAD */ diff --git a/src/inputPlugins/mpc_plugin.c b/src/inputPlugins/mpc_plugin.c index f74dc8ddc..fb1b0b56c 100644 --- a/src/inputPlugins/mpc_plugin.c +++ b/src/inputPlugins/mpc_plugin.c @@ -17,9 +17,6 @@ */ #include "../decoder_api.h" - -#ifdef HAVE_MPCDEC - #include "../utils.h" #include "../log.h" @@ -309,9 +306,3 @@ struct decoder_plugin mpcPlugin = { .stream_types = INPUT_PLUGIN_STREAM_URL | INPUT_PLUGIN_STREAM_FILE, .suffixes = mpcSuffixes, }; - -#else - -struct decoder_plugin mpcPlugin; - -#endif /* HAVE_MPCDEC */ diff --git a/src/inputPlugins/oggflac_plugin.c b/src/inputPlugins/oggflac_plugin.c index 53f233e0c..091b00988 100644 --- a/src/inputPlugins/oggflac_plugin.c +++ b/src/inputPlugins/oggflac_plugin.c @@ -20,9 +20,6 @@ */ #include "_flac_common.h" - -#ifdef HAVE_OGGFLAC - #include "_ogg_common.h" #include "../utils.h" @@ -356,9 +353,3 @@ struct decoder_plugin oggflacPlugin = { .suffixes = oggflac_Suffixes, .mime_types = oggflac_mime_types }; - -#else /* !HAVE_FLAC */ - -struct decoder_plugin oggflacPlugin; - -#endif /* HAVE_OGGFLAC */ diff --git a/src/inputPlugins/oggvorbis_plugin.c b/src/inputPlugins/oggvorbis_plugin.c index bf2448605..0eecb783f 100644 --- a/src/inputPlugins/oggvorbis_plugin.c +++ b/src/inputPlugins/oggvorbis_plugin.c @@ -18,12 +18,7 @@ /* TODO 'ogg' should probably be replaced with 'oggvorbis' in all instances */ -#include "../decoder_api.h" - -#ifdef HAVE_OGGVORBIS - #include "_ogg_common.h" - #include "../utils.h" #include "../log.h" @@ -390,9 +385,3 @@ struct decoder_plugin oggvorbisPlugin = { .suffixes = oggvorbis_Suffixes, .mime_types = oggvorbis_MimeTypes }; - -#else /* !HAVE_OGGVORBIS */ - -struct decoder_plugin oggvorbisPlugin; - -#endif /* HAVE_OGGVORBIS */ diff --git a/src/inputPlugins/wavpack_plugin.c b/src/inputPlugins/wavpack_plugin.c index 3e99980bd..14b7e5f69 100644 --- a/src/inputPlugins/wavpack_plugin.c +++ b/src/inputPlugins/wavpack_plugin.c @@ -19,9 +19,6 @@ */ #include "../decoder_api.h" - -#ifdef HAVE_WAVPACK - #include "../utils.h" #include "../log.h" #include "../path.h" @@ -575,9 +572,3 @@ struct decoder_plugin wavpackPlugin = { .suffixes = wavpackSuffixes, .mime_types = wavpackMimeTypes }; - -#else /* !HAVE_WAVPACK */ - -struct decoder_plugin wavpackPlugin; - -#endif /* !HAVE_WAVPACK */ |