From b3fd38bd1965ca8fec37cdd94552dc0f62f41372 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Thu, 31 Aug 2006 22:46:22 +0200 Subject: [PATCH] audiod: fix enum of supported audio formats Up to paraslash-0.2.12, audiod always supported every audio format since one could use an external decoder and player as the stream write command. With the single threaded audiod of 0.2.13 this is no longer possible, so make the enum of supported audio formats dynamic, i.e. it only consists of those formats for which suitable libs were found at compile time by configure. --- audiod.h | 10 ++++------ configure.ac | 3 +++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/audiod.h b/audiod.h index 077ce03e..8faf3231 100644 --- a/audiod.h +++ b/audiod.h @@ -1,12 +1,10 @@ /** \file audiod.h symbols exported from audiod.c */ int num_filters(int audio_format_num); int get_audio_format_num(char *name); -enum { - AUDIO_FORMAT_MP3, - AUDIO_FORMAT_OGG, - AUDIO_FORMAT_AAC, - NUM_AUDIO_FORMATS -}; + +/* audio formats supportedby para_audiod */ +enum { AUDIOD_AUDIO_FORMATS_ENUM}; + extern const char *audio_formats[]; #define DEFINE_AUDIO_FORMAT_ARRAY const char *audio_formats[] = {"mp3", "ogg", "aac", NULL} #define MAX_STREAM_SLOTS 5 diff --git a/configure.ac b/configure.ac index 71e82776..2dea89b3 100644 --- a/configure.ac +++ b/configure.ac @@ -494,6 +494,9 @@ inits="$(for i in $writers; do printf 'extern void '$i'_write_init(struct writer AC_DEFINE_UNQUOTED(DECLARE_WRITER_INITS, $inits, init functions of the supported writers) array="$(for i in $writers; do printf '{.init = '$i'_write_init},'; done)" AC_DEFINE_UNQUOTED(WRITER_ARRAY, $array, array of supported writers) +enum="$(for i in $audiod_audio_formats; do printf "AUDIO_FORMAT_${i}, " | tr '[a-z]' '[A-Z]'; done)" +AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMATS_ENUM, $enum NUM_AUDIO_FORMATS, + enum of audio formats supported by audiod) gui_cmdline_objs="gui.cmdline" gui_errlist_objs="exec close_on_fork signal string stat ringbuffer fd" -- 2.39.5