SDL_sound/SDL_sound-1.0.1-speex.patch

34 lines
1.3 KiB
Diff

--- configure.in
+++ configure.in
@@ -296,7 +296,7 @@
if test x$enable_speex = xyes; then
AC_CHECK_HEADER(ogg/ogg.h, have_ogg_hdr=yes)
AC_CHECK_LIB(ogg, ogg_sync_init, have_ogg_lib=yes)
- AC_CHECK_HEADER(speex.h, have_speex_hdr=yes)
+ AC_CHECK_HEADER(speex/speex.h, have_speex_hdr=yes)
AC_CHECK_LIB(speex, speex_bits_init, have_speex_lib=yes)
if test "x$have_ogg_hdr" = "xyes" -a "x$have_ogg_lib" = "xyes" -a "x$have_speex_hdr" = "xyes" -a "x$have_speex_lib" = "xyes"; then
LIBS="$LIBS -logg -lspeex"
--- decoders/speex.c
+++ decoders/speex.c
@@ -51,8 +51,8 @@
#include <assert.h>
#include <ogg/ogg.h>
-#include <speex.h>
-#include <speex_header.h>
+#include <speex/speex.h>
+#include <speex/speex_header.h>
#include "SDL_sound.h"
@@ -135,7 +135,7 @@
memcpy(&header, hptr, sizeof (SpeexHeader)); /* move to stack. */
free(hptr); /* lame that this forces you to malloc... */
- BAIL_IF_MACRO(header.mode >= SPEEX_NB_MODES, "SPEEX: Unknown mode", 0);
+ BAIL_IF_MACRO((header.mode < 0 || header.mode >= SPEEX_NB_MODES), "SPEEX: Unknown mode", 0);
mode = speex_mode_list[header.mode];
BAIL_IF_MACRO(header.speex_version_id > 1, "SPEEX: Unknown version", 0);
BAIL_IF_MACRO(mode->bitstream_version < header.mode_bitstream_version,