# HG changeset patch # User Ryan C. Gordon # Date 1014320815 0 # Node ID 6fe6de401b63cc4d2881a048bf4e5e94c71a6888 # Parent 9b6e82f7c8535cfdc59255c4e5c3cf043d242f85 mpglib support. diff -r 9b6e82f7c853 -r 6fe6de401b63 CHANGELOG --- 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 diff -r 9b6e82f7c853 -r 6fe6de401b63 Makefile.am --- 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 \ diff -r 9b6e82f7c853 -r 6fe6de401b63 SDL_sound.c --- 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) diff -r 9b6e82f7c853 -r 6fe6de401b63 acconfig.h --- 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 diff -r 9b6e82f7c853 -r 6fe6de401b63 configure.in --- 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 ]) diff -r 9b6e82f7c853 -r 6fe6de401b63 decoders/Makefile.am --- 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 \