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.
/** \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
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"