# HG changeset patch # User Ryan C. Gordon # Date 1005342229 0 # Node ID fa3e593b6a5ed51504895c69fbb32b6d7e37c660 # Parent ac46d8db8a8c52aeda22d9dd45ef0cc8fcea0d62 FLAC decoder added. diff -r ac46d8db8a8c -r fa3e593b6a5e SDL_sound.c --- a/SDL_sound.c Fri Nov 09 21:43:31 2001 +0000 +++ b/SDL_sound.c Fri Nov 09 21:43:49 2001 +0000 @@ -83,6 +83,10 @@ extern const Sound_DecoderFunctions __Sound_DecoderFunctions_MIDI; #endif +#if (defined SOUND_SUPPORTS_FLAC) +extern const Sound_DecoderFunctions __Sound_DecoderFunctions_FLAC; +#endif + typedef struct @@ -129,6 +133,10 @@ { 0, &__Sound_DecoderFunctions_MIDI }, #endif +#if (defined SOUND_SUPPORTS_FLAC) + { 0, &__Sound_DecoderFunctions_FLAC }, +#endif + { 0, NULL } }; diff -r ac46d8db8a8c -r fa3e593b6a5e acconfig.h --- a/acconfig.h Fri Nov 09 21:43:31 2001 +0000 +++ b/acconfig.h Fri Nov 09 21:43:49 2001 +0000 @@ -11,3 +11,4 @@ #undef SOUND_SUPPORTS_VOC #undef SOUND_SUPPORTS_WAV #undef SOUND_SUPPORTS_MIDI +#undef SOUND_SUPPORTS_FLAC diff -r ac46d8db8a8c -r fa3e593b6a5e configure.in --- a/configure.in Fri Nov 09 21:43:31 2001 +0000 +++ b/configure.in Fri Nov 09 21:43:49 2001 +0000 @@ -143,6 +143,19 @@ AC_DEFINE(SOUND_SUPPORTS_MIDI) fi +dnl Check for libFLAC +AC_ARG_ENABLE(flac, +[ --enable-flac enable FLAC decoding via libFLAC [default=yes]], + , enable_flac=yes) +if test x$enable_flac = xyes; then + AC_CHECK_HEADER(FLAC/all.h, have_flac_hdr=yes) + AC_CHECK_LIB(FLAC, FLAC__stream_decoder_new, have_flac_lib=yes) + if test x$have_flac_hdr = xyes -a x$have_flac_lib = xyes; then + LIBS="$LIBS -lFLAC" + AC_DEFINE(SOUND_SUPPORTS_FLAC) + fi +fi + dnl Check for SMPEG AC_ARG_ENABLE(smpeg, [ --enable-smpeg enable MP3 music via smpeg [default=yes]], @@ -173,7 +186,7 @@ dnl Check for vorbis AC_ARG_ENABLE(vorbis, -[ --enable-vorbis enable OGG music via vorbis [default=yes]], +[ --enable-vorbis enable OGG decoding via vorbis [default=yes]], , enable_vorbis=yes) if test x$enable_vorbis = xyes; then AM_PATH_VORBIS @@ -184,7 +197,6 @@ fi fi - # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([stdlib.h string.h]) diff -r ac46d8db8a8c -r fa3e593b6a5e decoders/Makefile.am --- a/decoders/Makefile.am Fri Nov 09 21:43:31 2001 +0000 +++ b/decoders/Makefile.am Fri Nov 09 21:43:49 2001 +0000 @@ -11,4 +11,5 @@ shn.c \ voc.c \ midi.c \ + flac.c \ wav.c