changeset 450:6d328f00c20d

Added Speex decoder.
author Ryan C. Gordon <icculus@icculus.org>
date Sat, 13 Sep 2003 20:28:39 +0000
parents daeb71a3f1ed
children 573eaefef003
files SDL_sound.c acconfig.h configure.in decoders/Makefile.am
diffstat 4 files changed, 27 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/SDL_sound.c	Sat Sep 13 20:27:33 2003 +0000
+++ b/SDL_sound.c	Sat Sep 13 20:28:39 2003 +0000
@@ -103,6 +103,10 @@
 extern const Sound_DecoderFunctions  __Sound_DecoderFunctions_QuickTime;
 #endif
 
+#if (defined SOUND_SUPPORTS_SPEEX)
+extern const Sound_DecoderFunctions  __Sound_DecoderFunctions_SPEEX;
+#endif
+
 typedef struct
 {
     int available;
@@ -167,6 +171,10 @@
     { 0, &__Sound_DecoderFunctions_QuickTime },
 #endif
 
+#if (defined SOUND_SUPPORTS_SPEEX)
+    { 0, &__Sound_DecoderFunctions_SPEEX },
+#endif
+
     { 0, NULL }
 };
 
--- a/acconfig.h	Sat Sep 13 20:27:33 2003 +0000
+++ b/acconfig.h	Sat Sep 13 20:28:39 2003 +0000
@@ -15,5 +15,7 @@
 #undef SOUND_SUPPORTS_FLAC
 #undef SOUND_SUPPORTS_SMPEG
 #undef SOUND_SUPPORTS_MPGLIB
+#undef SOUND_SUPPORTS_QUICKTIME
+#undef SOUND_SUPPORTS_SPEEX
 #undef SOUND_USE_ALTCVT
 
--- a/configure.in	Sat Sep 13 20:27:33 2003 +0000
+++ b/configure.in	Sat Sep 13 20:28:39 2003 +0000
@@ -235,6 +235,22 @@
   fi
 fi
 
+dnl Check for speex
+AC_ARG_ENABLE(speex,
+[  --enable-speex               enable SPX decoding via libspeex [default=yes]],
+              , enable_speex=yes)
+if test x$enable_speex = xyes; then
+  AC_CHECK_HEADER(ogg/ogg.h, have_ogg_hdr=yes)
+  AC_CHECK_LIB(ogg, ogg_sync_init, have_ogg_lib=yes)
+  AC_CHECK_HEADER(speex.h, have_speex_hdr=yes)
+  AC_CHECK_LIB(speex, speex_bits_init, have_speex_lib=yes)
+  if test "x$have_ogg_hdr" = "xyes" -a "x$have_ogg_lib" = "xyes" -a "x$have_speex_hdr" = "xyes" -a "x$have_speex_lib" = "xyes"; then
+    LIBS="$LIBS -logg -lspeex"
+    AC_DEFINE(SOUND_SUPPORTS_SPEEX)
+  fi
+fi
+
+
 dnl Check for PhysicsFS http://icculus.org/physfs/
 AC_ARG_ENABLE(physfs,
 [  --enable-physfs            enable PhysicsFS in playsound [default=yes]],
--- a/decoders/Makefile.am	Sat Sep 13 20:27:33 2003 +0000
+++ b/decoders/Makefile.am	Sat Sep 13 20:28:39 2003 +0000
@@ -17,4 +17,5 @@
 	voc.c		\
 	midi.c		\
 	flac.c		\
+	speex.c		\
 	wav.c