changeset 262:6fe6de401b63

mpglib support.
author Ryan C. Gordon <icculus@icculus.org>
date Thu, 21 Feb 2002 19:46:55 +0000
parents 9b6e82f7c853
children cde06af563f7
files CHANGELOG Makefile.am SDL_sound.c acconfig.h configure.in decoders/Makefile.am
diffstat 6 files changed, 41 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGELOG	Thu Feb 21 19:46:09 2002 +0000
+++ b/CHANGELOG	Thu Feb 21 19:46:55 2002 +0000
@@ -2,6 +2,9 @@
  * CHANGELOG.
  */
 
+02212002 - Changed SMPEG's URL to point to the icculus.org site. Added an
+           mpglib decoder (internal to SDL_sound; relies on no external libs)
+           and changes mp3.c to smpeg.c (and other associated things).
 02112002 - Committed a patch from Torbjörn to fix incorrect memory accesses
            in the Timidity code. Changed the magic number in the AU decoder
            to be bigendian (seems appropriate). Updated README for
--- a/Makefile.am	Thu Feb 21 19:46:09 2002 +0000
+++ b/Makefile.am	Thu Feb 21 19:46:55 2002 +0000
@@ -19,12 +19,18 @@
 TIMIDITY_LIB =
 endif
 
+if USE_MPGLIB
+MPGLIB_LIB = decoders/mpglib/libmpglib.la
+else
+MPGLIB_LIB =
+endif
+
 libSDL_sound_la_LDFLAGS = 		\
 	-release $(LT_RELEASE)	\
 	-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
 libSDL_sound_la_LIBADD =	\
 	decoders/libdecoders.la	\
-	$(TIMIDITY_LIB)
+	$(TIMIDITY_LIB) $(MPGLIB_LIB)
 
 EXTRA_DIST =	\
 	CREDITS \
--- a/SDL_sound.c	Thu Feb 21 19:46:09 2002 +0000
+++ b/SDL_sound.c	Thu Feb 21 19:46:55 2002 +0000
@@ -47,8 +47,12 @@
 
 /* The various decoder drivers... */
 
-#if (defined SOUND_SUPPORTS_MP3)
-extern const Sound_DecoderFunctions  __Sound_DecoderFunctions_MP3;
+#if (defined SOUND_SUPPORTS_SMPEG)
+extern const Sound_DecoderFunctions  __Sound_DecoderFunctions_SMPEG;
+#endif
+
+#if (defined SOUND_SUPPORTS_MPGLIB)
+extern const Sound_DecoderFunctions  __Sound_DecoderFunctions_MPGLIB;
 #endif
 
 #if (defined SOUND_SUPPORTS_MIKMOD)
@@ -105,8 +109,12 @@
 
 static decoder_element decoders[] =
 {
-#if (defined SOUND_SUPPORTS_MP3)
-    { 0, &__Sound_DecoderFunctions_MP3 },
+#if (defined SOUND_SUPPORTS_SMPEG)
+    { 0, &__Sound_DecoderFunctions_SMPEG },
+#endif
+
+#if (defined SOUND_SUPPORTS_MPGLIB)
+    { 0, &__Sound_DecoderFunctions_MPGLIB },
 #endif
 
 #if (defined SOUND_SUPPORTS_MODPLUG)
--- a/acconfig.h	Thu Feb 21 19:46:09 2002 +0000
+++ b/acconfig.h	Thu Feb 21 19:46:55 2002 +0000
@@ -6,7 +6,6 @@
 #undef SOUND_SUPPORTS_AU
 #undef SOUND_SUPPORTS_MIKMOD
 #undef SOUND_SUPPORTS_MODPLUG
-#undef SOUND_SUPPORTS_MP3
 #undef SOUND_SUPPORTS_OGG
 #undef SOUND_SUPPORTS_RAW
 #undef SOUND_SUPPORTS_SHN
@@ -14,3 +13,5 @@
 #undef SOUND_SUPPORTS_WAV
 #undef SOUND_SUPPORTS_MIDI
 #undef SOUND_SUPPORTS_FLAC
+#undef SOUND_SUPPORTS_SMPEG
+#undef SOUND_SUPPORTS_MPGLIB
--- a/configure.in	Thu Feb 21 19:46:09 2002 +0000
+++ b/configure.in	Thu Feb 21 19:46:55 2002 +0000
@@ -142,7 +142,7 @@
     AC_DEFINE(SOUND_SUPPORTS_SHN)
 fi
 
-dnl Check for the MIDI pipe decoder...
+dnl Check for the MIDI decoder...
 AC_ARG_ENABLE(midi,
 [  --enable-midi              enable software MIDI music [default=yes]],
               , enable_midi=yes)
@@ -165,7 +165,7 @@
 
 dnl Check for SMPEG
 AC_ARG_ENABLE(smpeg,
-[  --enable-smpeg             enable MP3 music via smpeg [default=yes]],
+[  --enable-smpeg             enable MP3 decoding via smpeg [default=yes]],
               , enable_smpeg=yes)
 if test x$enable_smpeg = xyes; then
   SMPEG_VERSION=0.4.3
@@ -173,10 +173,19 @@
   if test "x$no_smpeg" = "x" ; then
     CFLAGS="$CFLAGS $SMPEG_CFLAGS"
     LIBS="$LIBS $SMPEG_LIBS"
-    AC_DEFINE(SOUND_SUPPORTS_MP3)
+    AC_DEFINE(SOUND_SUPPORTS_SMPEG)
   fi
 fi
 
+dnl Check for the MIDI decoder...
+AC_ARG_ENABLE(mpglib,
+[  --enable-mpglib            enable MP3 decoding internally [default=yes]],
+              , enable_mpglib=yes)
+if test x$enable_mpglib = xyes; then
+  AC_DEFINE(SOUND_SUPPORTS_MPGLIB)
+fi
+
+
 dnl Check for libmikmod
 AC_ARG_ENABLE(mikmod,
 [  --enable-mikmod            enable MOD decoding via mikmod [default=yes]],
@@ -243,10 +252,12 @@
 
 dnl Add Makefile conditionals
 AM_CONDITIONAL(USE_TIMIDITY, test x$enable_midi = xyes)
+AM_CONDITIONAL(USE_MPGLIB, test x$enable_mpglib = xyes)
 
 AC_OUTPUT([
 Makefile
 decoders/Makefile
 decoders/timidity/Makefile
+decoders/mpglib/Makefile
 playsound/Makefile
 ])
--- a/decoders/Makefile.am	Thu Feb 21 19:46:09 2002 +0000
+++ b/decoders/Makefile.am	Thu Feb 21 19:46:55 2002 +0000
@@ -1,6 +1,6 @@
 noinst_LTLIBRARIES = libdecoders.la
 
-SUBDIRS = timidity
+SUBDIRS = timidity mpglib
 
 INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/decoders/timidity
 
@@ -9,7 +9,8 @@
 	au.c		\
 	mikmod.c	\
 	modplug.c	\
-	mp3.c		\
+	mpglib.c	\
+	smpeg.c		\
 	ogg.c		\
 	raw.c		\
 	shn.c		\