From 98d0c34a0377546a4ed0062ad32e8161d611d6e6 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sat, 9 Sep 2006 18:02:53 +0200 Subject: [PATCH] audiod: Make audio_formats[] dynamic It should only contain those audio formats that are actually supported by audiod. --- audiod.c | 3 +-- audiod.h | 9 ++++++--- configure.ac | 2 ++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/audiod.c b/audiod.c index ed5344c0..0629d7c6 100644 --- a/audiod.c +++ b/audiod.c @@ -41,7 +41,7 @@ /** define the array of error lists needed by para_audiod */ INIT_AUDIOD_ERRLISTS; /** define the array containing all supported audio formats */ -DEFINE_AUDIO_FORMAT_ARRAY; +const char *audio_formats[] = {AUDIOD_AUDIO_FORMAT_ARRAY NULL}; /** defines how to handle one supported audio format */ struct audio_format_info { @@ -753,7 +753,6 @@ static int init_receivers(void) for (i = conf.receiver_given - 1; i >= 0; i--) { char *arg = conf.receiver_arg[i]; char *recv_arg = strchr(arg, ':'); - PARA_INFO_LOG("arg: %s\n", arg); ret = -E_MISSING_COLON; if (!recv_arg) goto out; diff --git a/audiod.h b/audiod.h index 8faf3231..856bc051 100644 --- a/audiod.h +++ b/audiod.h @@ -2,12 +2,15 @@ int num_filters(int audio_format_num); int get_audio_format_num(char *name); -/* audio formats supportedby para_audiod */ -enum { AUDIOD_AUDIO_FORMATS_ENUM}; +/** enum of audio formats supported by para_audiod */ +enum {AUDIOD_AUDIO_FORMATS_ENUM}; +/** array of audio format names supported by para_audiod */ extern const char *audio_formats[]; -#define DEFINE_AUDIO_FORMAT_ARRAY const char *audio_formats[] = {"mp3", "ogg", "aac", NULL} + +/** maximal number of simultaneous instances */ #define MAX_STREAM_SLOTS 5 + /** * the possible modes of operation * diff --git a/configure.ac b/configure.ac index 2dea89b3..408851ed 100644 --- a/configure.ac +++ b/configure.ac @@ -497,6 +497,8 @@ 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) +names="$(for i in $audiod_audio_formats; do printf \"$i\",' ' ; done)" +AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMAT_ARRAY, $names, array 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