Skip to content

Commit

Permalink
mpglib support.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Feb 21, 2002
1 parent 8d3c260 commit c4523f3
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 11 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion Makefile.am
Expand Up @@ -19,12 +19,18 @@ else
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 \
Expand Down
16 changes: 12 additions & 4 deletions SDL_sound.c
Expand Up @@ -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)
Expand Down Expand Up @@ -105,8 +109,12 @@ typedef struct

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)
Expand Down
3 changes: 2 additions & 1 deletion acconfig.h
Expand Up @@ -6,11 +6,12 @@
#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
#undef SOUND_SUPPORTS_VOC
#undef SOUND_SUPPORTS_WAV
#undef SOUND_SUPPORTS_MIDI
#undef SOUND_SUPPORTS_FLAC
#undef SOUND_SUPPORTS_SMPEG
#undef SOUND_SUPPORTS_MPGLIB
17 changes: 14 additions & 3 deletions configure.in
Expand Up @@ -142,7 +142,7 @@ if test x$enable_shn = xyes; then
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)
Expand All @@ -165,18 +165,27 @@ fi

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
AM_PATH_SMPEG($SMPEG_VERSION, , no_smpeg=yes)
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]],
Expand Down Expand Up @@ -243,10 +252,12 @@ AC_CHECK_FUNCS([memset strrchr])

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
])
5 changes: 3 additions & 2 deletions decoders/Makefile.am
@@ -1,6 +1,6 @@
noinst_LTLIBRARIES = libdecoders.la

SUBDIRS = timidity
SUBDIRS = timidity mpglib

INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/decoders/timidity

Expand All @@ -9,7 +9,8 @@ libdecoders_la_SOURCES = \
au.c \
mikmod.c \
modplug.c \
mp3.c \
mpglib.c \
smpeg.c \
ogg.c \
raw.c \
shn.c \
Expand Down

0 comments on commit c4523f3

Please sign in to comment.