Make ogg vorbis support to work if libsndfile >= 1.0.18

This commit is contained in:
David Henningsson 2009-10-09 18:43:27 +00:00
parent aac65ca01a
commit 629fd249ff
3 changed files with 27 additions and 1 deletions

View file

@ -170,9 +170,17 @@ else
fi
if test "$LIBSNDFILE_SUPPORT" = "1"; then
PKG_CHECK_MODULES(LIBSNDFILE_VORBIS, sndfile >= 1.0.18, LIBSNDFILE_HASVORBIS=1, LIBSNDFILE_HASVORBIS=0)
AC_DEFINE(LIBSNDFILE_SUPPORT, 1, [Define to enable libsndfile support])
if test "$LIBSNDFILE_HASVORBIS" = "1"; then
AC_DEFINE(LIBSNDFILE_HASVORBIS, 1, [libsndfile has ogg vorbis support])
fi
else
LIBSNDFILE_HASVORBIS=0
fi
AM_CONDITIONAL(LIBSNDFILE_SUPPORT, test "$LIBSNDFILE_SUPPORT" = "1")
AM_CONDITIONAL(LIBSNDFILE_HASVORBIS, test "$LIBSNDFILE_HASVORBIS" = "1")
AC_SUBST(LIBSNDFILE_CFLAGS)
AC_SUBST(LIBSNDFILE_LIBS)
@ -443,7 +451,11 @@ echo "**************************************************************"
echo "Summary:"
if test "${LIBSNDFILE_SUPPORT}" = "1"; then
echo "libsndfile: yes"
if test "${LIBSNDFILE_HASVORBIS}" = "1"; then
echo "libsndfile: yes (with ogg vorbis support)"
else
echo "libsndfile: yes"
fi
else
echo "libsndfile: no (raw audio file rendering only)"
fi

View file

@ -132,6 +132,9 @@
/* Include the LADSPA Fx unit */
#undef LADSPA
/* libsndfile has ogg vorbis support */
#undef LIBSNDFILE_HASVORBIS
/* Define to enable libsndfile support */
#undef LIBSNDFILE_SUPPORT
@ -166,6 +169,9 @@
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION

View file

@ -425,6 +425,7 @@ fluid_file_renderer_parse_options (char *filetype, char *format, char *endian,
return FALSE;
}
info->format = (info->format & ~SF_FORMAT_TYPEMASK) | type;
/* Look for subtype */
@ -443,6 +444,13 @@ fluid_file_renderer_parse_options (char *filetype, char *format, char *endian,
info->format = (info->format & ~SF_FORMAT_SUBMASK) | format_ids[i];
}
#if LIBSNDFILE_HASVORBIS
/* Force subformat to vorbis as nothing else would make sense currently */
if ((info->format & SF_FORMAT_TYPEMASK) == SF_FORMAT_OGG) {
info->format = (info->format & ~SF_FORMAT_SUBMASK) | SF_FORMAT_VORBIS;
}
#endif
/* Look for endian */
if (endian)
{