From 7091235a683bfcaea32e95a81b86842de7657aa7 Mon Sep 17 00:00:00 2001 From: Warren Dukes Date: Sun, 11 Apr 2004 04:49:27 +0000 Subject: add --disable-audio configure option git-svn-id: https://svn.musicpd.org/mpd/trunk@679 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/audio.c | 20 ++++++++++++++++++-- src/audio.h | 4 ---- src/flac_decode.c | 1 - src/mp3_decode.c | 1 + 4 files changed, 19 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index f8ad963ea..df497203e 100644 --- a/src/audio.c +++ b/src/audio.c @@ -25,6 +25,9 @@ #include #include +#ifdef HAVE_AUDIO +#include + int audio_write_size; int audio_ao_driver_id; @@ -32,8 +35,10 @@ ao_option * audio_ao_options; AudioFormat audio_format; ao_device * audio_device = NULL; +#endif void initAudioDriver() { +#ifdef HAVE_AUDIO ao_info * ai; char * dup; char * stk1; @@ -107,15 +112,19 @@ void initAudioDriver() { } } free(dup); +#endif } void finishAudioDriver() { +#ifdef HAVE_AUDIO ao_free_options(audio_ao_options); ao_shutdown(); +#endif } int isCurrentAudioFormat(AudioFormat * audioFormat) { +#ifdef HAVE_AUDIO if(!audio_device || !audioFormat) return 0; if(audio_format.bits!=audioFormat->bits || @@ -124,11 +133,12 @@ int isCurrentAudioFormat(AudioFormat * audioFormat) { { return 0; } - +#endif return 1; } int initAudio(AudioFormat * audioFormat) { +#ifdef HAVE_AUDIO ao_sample_format format; if(audio_device && !isCurrentAudioFormat(audioFormat)) { @@ -154,12 +164,13 @@ int initAudio(AudioFormat * audioFormat) { if(audio_device==NULL) return -1; } - +#endif return 0; } int playAudio(char * playChunk, int size) { +#ifdef HAVE_AUDIO int send; if(audio_device==NULL) { @@ -181,19 +192,23 @@ int playAudio(char * playChunk, int size) { size-=send; } +#endif return 0; } void finishAudio() { +#ifdef HAVE_AUDIO if(audio_device) { blockSignals(); ao_close(audio_device); audio_device = NULL; unblockSignals(); } +#endif } void audioError() { +#ifdef HAVE_AUDIO if(errno==AO_ENOTLIVE) { ERROR("not a live ao device\n"); } @@ -203,4 +218,5 @@ void audioError() { else if(errno==AO_EBADOPTION) { ERROR("bad driver option\n"); } +#endif } diff --git a/src/audio.h b/src/audio.h index da9784d1b..917644f15 100644 --- a/src/audio.h +++ b/src/audio.h @@ -24,7 +24,6 @@ #include "mpd_types.h" #include -#include #define AUDIO_AO_DRIVER_DEFAULT "default" @@ -34,9 +33,6 @@ typedef struct _AudioFormat { mpd_sint8 bits; } AudioFormat; -extern int audio_ao_driver_id; -extern ao_option * audio_ao_options; - void initAudioDriver(); void finishAudioDriver(); diff --git a/src/flac_decode.c b/src/flac_decode.c index 25857cb6e..611b198f6 100644 --- a/src/flac_decode.c +++ b/src/flac_decode.c @@ -45,7 +45,6 @@ typedef struct { /* this code is based on flac123, from flac-tools */ int flacSendChunk(FlacData * data); -void flacPlayfile(const char * file, Buffer * cb, ao_sample_format * format); void flacError(const FLAC__FileDecoder *, FLAC__StreamDecoderErrorStatus, void *); void flacPrintErroredState(FLAC__FileDecoderState state, char * file); void flacMetadata(const FLAC__FileDecoder *, const FLAC__StreamMetadata *, void *); diff --git a/src/mp3_decode.c b/src/mp3_decode.c index 84192078b..f0b57f59e 100644 --- a/src/mp3_decode.c +++ b/src/mp3_decode.c @@ -42,6 +42,7 @@ #include #include #include +#include #define FRAMES_CUSHION 2000 -- cgit v1.2.3