]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
audiod: fix enum of supported audio formats
authorAndre Noll <maan@congo.fml.local>
Thu, 31 Aug 2006 20:46:22 +0000 (22:46 +0200)
committerAndre Noll <maan@congo.fml.local>
Thu, 31 Aug 2006 20:46:22 +0000 (22:46 +0200)
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
configure.ac

index 077ce03e415f45c2937d953a8602193e7f6c68a1..8faf323118aca2c6dc7e859a9192f1f39907b2fe 100644 (file)
--- 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
index 71e82776dc8af35a40fdf8db7ea935fdd9bf9606..2dea89b391e7a64a9aff11e5efa81f30841c5f4f 100644 (file)
@@ -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"