aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-26 21:58:37 +0100
committerMax Kellermann <max@duempel.org>2008-10-26 21:58:37 +0100
commit0800c6f4ca36012b65e3cde825663adc1eafeae2 (patch)
tree5d0f24a02042c48a30d6b67920f77ef65e7e6215 /src
parent3dac99034afe14e61554f327329c11d32962ae04 (diff)
downloadmpd-0800c6f4ca36012b65e3cde825663adc1eafeae2.tar.gz
mpd-0800c6f4ca36012b65e3cde825663adc1eafeae2.tar.xz
mpd-0800c6f4ca36012b65e3cde825663adc1eafeae2.zip
output: don't compile plugins which are disabled
Don't compile the sources of disabled output plugins at all.
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am61
-rw-r--r--src/output/alsa_plugin.c14
-rw-r--r--src/output/ao_plugin.c8
-rw-r--r--src/output/fifo_plugin.c9
-rw-r--r--src/output/jack_plugin.c9
-rw-r--r--src/output/mvp_plugin.c8
-rw-r--r--src/output/oss_plugin.c8
-rw-r--r--src/output/osx_plugin.c12
-rw-r--r--src/output/pulse_plugin.c8
-rw-r--r--src/output/shout_mp3.c6
-rw-r--r--src/output/shout_ogg.c6
-rw-r--r--src/output/shout_plugin.h5
-rw-r--r--src/output_list.c18
-rw-r--r--src/output_list.h4
14 files changed, 72 insertions, 104 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 15d15e175..511ffac77 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,19 +1,5 @@
bin_PROGRAMS = mpd
-mpd_output = \
- output/shout_plugin.c \
- output/shout_ogg.c \
- output/shout_mp3.c \
- output/null_plugin.c \
- output/fifo_plugin.c \
- output/alsa_plugin.c \
- output/ao_plugin.c \
- output/oss_plugin.c \
- output/osx_plugin.c \
- output/pulse_plugin.c \
- output/mvp_plugin.c \
- output/jack_plugin.c
-
mpd_headers = \
notify.h \
ack.h \
@@ -102,7 +88,6 @@ mpd_headers = \
mpd_SOURCES = \
$(mpd_headers) \
- $(mpd_output) \
notify.c \
audio.c \
audioOutput.c \
@@ -111,6 +96,7 @@ mpd_SOURCES = \
output_thread.c \
output_control.c \
output_init.c \
+ output/null_plugin.c \
buffer2array.c \
command.c \
idle.c \
@@ -248,6 +234,51 @@ mpd_SOURCES += input_curl.c
endif
+if HAVE_ALSA
+mpd_SOURCES += output/alsa_plugin.c
+endif
+
+if HAVE_AO
+mpd_SOURCES += output/ao_plugin.c
+endif
+
+if HAVE_FIFO
+mpd_SOURCES += output/fifo_plugin.c
+endif
+
+if HAVE_JACK
+mpd_SOURCES += output/jack_plugin.c
+endif
+
+if HAVE_MVP
+mpd_SOURCES += output/mvp_plugin.c
+endif
+
+if HAVE_OSS
+mpd_SOURCES += output/oss_plugin.c
+endif
+
+if HAVE_OSX
+mpd_SOURCES += output/osx_plugin.c
+endif
+
+if HAVE_PULSE
+mpd_SOURCES += output/pulse_plugin.c
+endif
+
+if HAVE_SHOUT
+mpd_SOURCES += output/shout_plugin.c
+endif
+
+if HAVE_SHOUT_MP3
+mpd_SOURCES += output/shout_mp3.c
+endif
+
+if HAVE_SHOUT_OGG
+mpd_SOURCES += output/shout_ogg.c
+endif
+
+
mpd_CFLAGS = $(MPD_CFLAGS)
mpd_CPPFLAGS = \
$(CURL_CFLAGS) \
diff --git a/src/output/alsa_plugin.c b/src/output/alsa_plugin.c
index 1845f1b76..e812e49fc 100644
--- a/src/output/alsa_plugin.c
+++ b/src/output/alsa_plugin.c
@@ -17,8 +17,10 @@
*/
#include "../output_api.h"
+#include "../utils.h"
+#include "../log.h"
-#ifdef HAVE_ALSA
+#include <alsa/asoundlib.h>
#define ALSA_PCM_NEW_HW_PARAMS_API
#define ALSA_PCM_NEW_SW_PARAMS_API
@@ -27,11 +29,6 @@ static const char default_device[] = "default";
#define MPD_ALSA_RETRY_NR 5
-#include "../utils.h"
-#include "../log.h"
-
-#include <alsa/asoundlib.h>
-
typedef snd_pcm_sframes_t alsa_writei_t(snd_pcm_t * pcm, const void *buffer,
snd_pcm_uframes_t size);
@@ -437,8 +434,3 @@ const struct audio_output_plugin alsaPlugin = {
.cancel = alsa_dropBufferedAudio,
.close = alsa_closeDevice,
};
-
-#else /* HAVE ALSA */
-
-DISABLED_AUDIO_OUTPUT_PLUGIN(alsaPlugin)
-#endif /* HAVE_ALSA */
diff --git a/src/output/ao_plugin.c b/src/output/ao_plugin.c
index e731f972a..b5cebc93b 100644
--- a/src/output/ao_plugin.c
+++ b/src/output/ao_plugin.c
@@ -17,9 +17,6 @@
*/
#include "../output_api.h"
-
-#ifdef HAVE_AO
-
#include "../utils.h"
#include "../log.h"
@@ -246,8 +243,3 @@ const struct audio_output_plugin aoPlugin = {
.cancel = audioOutputAo_dropBufferedAudio,
.close = audioOutputAo_closeDevice,
};
-
-#else
-
-DISABLED_AUDIO_OUTPUT_PLUGIN(aoPlugin)
-#endif
diff --git a/src/output/fifo_plugin.c b/src/output/fifo_plugin.c
index d7eb91ff6..cd83177f8 100644
--- a/src/output/fifo_plugin.c
+++ b/src/output/fifo_plugin.c
@@ -17,9 +17,6 @@
*/
#include "../output_api.h"
-
-#ifdef HAVE_FIFO
-
#include "../log.h"
#include "../utils.h"
#include "../timer.h"
@@ -282,9 +279,3 @@ const struct audio_output_plugin fifoPlugin = {
.cancel = fifo_dropBufferedAudio,
.close = fifo_closeDevice,
};
-
-#else /* HAVE_FIFO */
-
-DISABLED_AUDIO_OUTPUT_PLUGIN(fifoPlugin)
-
-#endif /* !HAVE_FIFO */
diff --git a/src/output/jack_plugin.c b/src/output/jack_plugin.c
index 6f2bcd3a1..7f10db976 100644
--- a/src/output/jack_plugin.c
+++ b/src/output/jack_plugin.c
@@ -16,9 +16,6 @@
*/
#include "../output_api.h"
-
-#ifdef HAVE_JACK
-
#include "../utils.h"
#include "../log.h"
@@ -478,9 +475,3 @@ const struct audio_output_plugin jackPlugin = {
.cancel = mpd_jack_cancel,
.close = mpd_jack_close,
};
-
-#else /* HAVE JACK */
-
-DISABLED_AUDIO_OUTPUT_PLUGIN(jackPlugin)
-
-#endif /* HAVE_JACK */
diff --git a/src/output/mvp_plugin.c b/src/output/mvp_plugin.c
index 70dd25f9d..94f4f0ea7 100644
--- a/src/output/mvp_plugin.c
+++ b/src/output/mvp_plugin.c
@@ -20,9 +20,6 @@
*/
#include "../output_api.h"
-
-#ifdef HAVE_MVP
-
#include "../utils.h"
#include "../log.h"
@@ -273,8 +270,3 @@ const struct audio_output_plugin mvpPlugin = {
.cancel = mvp_dropBufferedAudio,
.close = mvp_closeDevice,
};
-
-#else /* HAVE_MVP */
-
-DISABLED_AUDIO_OUTPUT_PLUGIN(mvpPlugin)
-#endif /* HAVE_MVP */
diff --git a/src/output/oss_plugin.c b/src/output/oss_plugin.c
index 67ea11fe4..53d047101 100644
--- a/src/output/oss_plugin.c
+++ b/src/output/oss_plugin.c
@@ -20,9 +20,6 @@
*/
#include "../output_api.h"
-
-#ifdef HAVE_OSS
-
#include "../utils.h"
#include "../log.h"
@@ -564,8 +561,3 @@ const struct audio_output_plugin ossPlugin = {
.cancel = oss_dropBufferedAudio,
.close = oss_closeDevice,
};
-
-#else /* HAVE OSS */
-
-DISABLED_AUDIO_OUTPUT_PLUGIN(ossPlugin)
-#endif /* HAVE_OSS */
diff --git a/src/output/osx_plugin.c b/src/output/osx_plugin.c
index 65060cc8c..a3f67fa68 100644
--- a/src/output/osx_plugin.c
+++ b/src/output/osx_plugin.c
@@ -17,14 +17,11 @@
*/
#include "../output_api.h"
-
-#ifdef HAVE_OSX
-
-#include <AudioUnit/AudioUnit.h>
-
#include "../utils.h"
#include "../log.h"
+#include <AudioUnit/AudioUnit.h>
+
typedef struct _OsxData {
AudioUnit au;
pthread_mutex_t mutex;
@@ -361,8 +358,3 @@ const struct audio_output_plugin osxPlugin = {
.cancel = osx_dropBufferedAudio,
.close = osx_closeDevice,
};
-
-#else
-
-DISABLED_AUDIO_OUTPUT_PLUGIN(osxPlugin)
-#endif
diff --git a/src/output/pulse_plugin.c b/src/output/pulse_plugin.c
index b1ce3d049..ff3c2f126 100644
--- a/src/output/pulse_plugin.c
+++ b/src/output/pulse_plugin.c
@@ -17,9 +17,6 @@
*/
#include "../output_api.h"
-
-#ifdef HAVE_PULSE
-
#include "../utils.h"
#include "../log.h"
@@ -211,8 +208,3 @@ const struct audio_output_plugin pulsePlugin = {
.cancel = pulse_dropBufferedAudio,
.close = pulse_closeDevice,
};
-
-#else /* HAVE_PULSE */
-
-DISABLED_AUDIO_OUTPUT_PLUGIN(pulsePlugin)
-#endif /* HAVE_PULSE */
diff --git a/src/output/shout_mp3.c b/src/output/shout_mp3.c
index e57b0c385..804d3af12 100644
--- a/src/output/shout_mp3.c
+++ b/src/output/shout_mp3.c
@@ -17,10 +17,8 @@
*/
#include "shout_plugin.h"
-
-#ifdef HAVE_SHOUT_MP3
-
#include "../utils.h"
+
#include <lame/lame.h>
struct lame_data {
@@ -184,5 +182,3 @@ const struct shout_encoder_plugin shout_mp3_encoder = {
shout_mp3_encoder_init_encoder,
shout_mp3_encoder_send_metadata,
};
-
-#endif
diff --git a/src/output/shout_ogg.c b/src/output/shout_ogg.c
index 248ffd1e8..441093e90 100644
--- a/src/output/shout_ogg.c
+++ b/src/output/shout_ogg.c
@@ -17,10 +17,8 @@
*/
#include "shout_plugin.h"
-
-#ifdef HAVE_SHOUT_OGG
-
#include "../utils.h"
+
#include <vorbis/vorbisenc.h>
struct ogg_vorbis_data {
@@ -302,5 +300,3 @@ const struct shout_encoder_plugin shout_ogg_encoder = {
shout_ogg_encoder_init_encoder,
shout_ogg_encoder_send_metadata,
};
-
-#endif
diff --git a/src/output/shout_plugin.h b/src/output/shout_plugin.h
index 2cfe68f29..ae7d23b03 100644
--- a/src/output/shout_plugin.h
+++ b/src/output/shout_plugin.h
@@ -20,9 +20,6 @@
#define AUDIO_OUTPUT_SHOUT_H
#include "../output_api.h"
-
-#ifdef HAVE_SHOUT
-
#include "../conf.h"
#include "../timer.h"
@@ -89,5 +86,3 @@ extern const struct shout_encoder_plugin shout_mp3_encoder;
extern const struct shout_encoder_plugin shout_ogg_encoder;
#endif
-
-#endif
diff --git a/src/output_list.c b/src/output_list.c
index 7f597b687..c45227c4b 100644
--- a/src/output_list.c
+++ b/src/output_list.c
@@ -32,16 +32,34 @@ extern const struct audio_output_plugin mvpPlugin;
extern const struct audio_output_plugin jackPlugin;
const struct audio_output_plugin *audio_output_plugins[] = {
+#ifdef HAVE_SHOUT
&shoutPlugin,
+#endif
&nullPlugin,
+#ifdef HAVE_FIFO
&fifoPlugin,
+#endif
+#ifdef HAVE_ALSA
&alsaPlugin,
+#endif
+#ifdef HAVE_AO
&aoPlugin,
+#endif
+#ifdef HAVE_OSS
&ossPlugin,
+#endif
+#ifdef HAVE_OSX
&osxPlugin,
+#endif
+#ifdef HAVE_PULSE
&pulsePlugin,
+#endif
+#ifdef HAVE_MVP
&mvpPlugin,
+#endif
+#ifdef HAVE_JACK
&jackPlugin,
+#endif
NULL
};
diff --git a/src/output_list.h b/src/output_list.h
index d0fcf1285..1be0b8169 100644
--- a/src/output_list.h
+++ b/src/output_list.h
@@ -25,8 +25,6 @@ const struct audio_output_plugin *
audio_output_plugin_get(const char *name);
#define audio_output_plugins_for_each(plugin, i) \
- for (i = 0; (plugin = audio_output_plugins[i]) != NULL; ++i) \
- if (plugin->name != NULL)
-
+ for (i = 0; (plugin = audio_output_plugins[i]) != NULL; ++i)
#endif