Skip to content

Commit

Permalink
FLAC decoder added.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Nov 9, 2001
1 parent f05d0a3 commit ca9c44c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
8 changes: 8 additions & 0 deletions SDL_sound.c
Expand Up @@ -83,6 +83,10 @@ extern const Sound_DecoderFunctions __Sound_DecoderFunctions_SHN;
extern const Sound_DecoderFunctions __Sound_DecoderFunctions_MIDI;
#endif

#if (defined SOUND_SUPPORTS_FLAC)
extern const Sound_DecoderFunctions __Sound_DecoderFunctions_FLAC;
#endif



typedef struct
Expand Down Expand Up @@ -129,6 +133,10 @@ static decoder_element decoders[] =
{ 0, &__Sound_DecoderFunctions_MIDI },
#endif

#if (defined SOUND_SUPPORTS_FLAC)
{ 0, &__Sound_DecoderFunctions_FLAC },
#endif

{ 0, NULL }
};

Expand Down
1 change: 1 addition & 0 deletions acconfig.h
Expand Up @@ -11,3 +11,4 @@
#undef SOUND_SUPPORTS_VOC
#undef SOUND_SUPPORTS_WAV
#undef SOUND_SUPPORTS_MIDI
#undef SOUND_SUPPORTS_FLAC
16 changes: 14 additions & 2 deletions configure.in
Expand Up @@ -143,6 +143,19 @@ if test x$enable_midi = xyes; then
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]],
Expand Down Expand Up @@ -173,7 +186,7 @@ fi

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
Expand All @@ -184,7 +197,6 @@ if test x$enable_vorbis = xyes; then
fi
fi


# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h string.h])
Expand Down
1 change: 1 addition & 0 deletions decoders/Makefile.am
Expand Up @@ -11,4 +11,5 @@ libdecoders_la_SOURCES = \
shn.c \
voc.c \
midi.c \
flac.c \
wav.c

0 comments on commit ca9c44c

Please sign in to comment.