[asterisk-commits] rmudgett: branch 1.8 r355608 - in /branches/1.8: ./ autoconf/ formats/ includ...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Feb 16 13:26:20 CST 2012
Author: rmudgett
Date: Thu Feb 16 13:26:16 2012
New Revision: 355608
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=355608
Log:
Fix compile problem when old version of libvorbisfile v1.1.2 is used.
The principle difference between libvorbisfile v1.1.2 and newer (at least
v1.2.0) is the addition of the predefined callbacks OV_CALLBACKS_xxx in
vorbis/vorbisfile.h used for ov_open_callbacks().
* Updated the configure script to detect if libvorbisfile.h declares
OV_CALLBACKS_NOCLOSE.
* Copied the declaration of OV_CALLBACKS_NOCLOSE from v1.2.0 to allow
v1.1.2 to compile.
(closes issue ASTERISK-19370)
Reported by: Jonn Taylor
Added:
branches/1.8/autoconf/ast_c_declare_check.m4 (with props)
Modified:
branches/1.8/configure
branches/1.8/configure.ac
branches/1.8/formats/format_ogg_vorbis.c
branches/1.8/include/asterisk/autoconfig.h.in
Added: branches/1.8/autoconf/ast_c_declare_check.m4
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/autoconf/ast_c_declare_check.m4?view=auto&rev=355608
==============================================================================
--- branches/1.8/autoconf/ast_c_declare_check.m4 (added)
+++ branches/1.8/autoconf/ast_c_declare_check.m4 Thu Feb 16 13:26:16 2012
@@ -1,0 +1,31 @@
+# Check if a given symbol is declared using a certain header.
+# Check whether SYMBOL (a function, variable, or constant) is declared.
+
+# AST_C_DECLARE_CHECK([package], [symbol], [header file], [version])
+AC_DEFUN([AST_C_DECLARE_CHECK],
+[
+ if test "x${PBX_$1}" != "x1" -a "${USE_$1}" != "no"; then
+ AC_MSG_CHECKING([for $2 declared in $3])
+ saved_cppflags="${CPPFLAGS}"
+ if test "x${$1_DIR}" != "x"; then
+ $1_INCLUDE="-I${$1_DIR}/include"
+ fi
+ CPPFLAGS="${CPPFLAGS} ${$1_INCLUDE}"
+
+ AC_COMPILE_IFELSE(
+ [ AC_LANG_PROGRAM( [#include <$3>],
+ [#if !defined($2)
+ (void) $2;
+ #endif
+ ])],
+ [ AC_MSG_RESULT(yes)
+ PBX_$1=1
+ AC_DEFINE([HAVE_$1], 1, [Define if your system has $2 declared.])
+ m4_ifval([$4], [AC_DEFINE([HAVE_$1_VERSION], $4, [Define $1 headers version])])
+ ],
+ [ AC_MSG_RESULT(no) ]
+ )
+
+ CPPFLAGS="${saved_cppflags}"
+ fi
+])
Propchange: branches/1.8/autoconf/ast_c_declare_check.m4
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: branches/1.8/autoconf/ast_c_declare_check.m4
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: branches/1.8/autoconf/ast_c_declare_check.m4
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: branches/1.8/configure.ac
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/configure.ac?view=diff&rev=355608&r1=355607&r2=355608
==============================================================================
--- branches/1.8/configure.ac (original)
+++ branches/1.8/configure.ac Thu Feb 16 13:26:16 2012
@@ -2081,6 +2081,7 @@
else
AST_EXT_LIB_CHECK([VORBIS], [vorbis], [vorbis_info_init], [vorbis/codec.h], [-lm -lvorbisenc -lvorbisfile])
fi
+AST_C_DECLARE_CHECK([VORBIS_OPEN_CALLBACKS], [OV_CALLBACKS_NOCLOSE], [vorbis/vorbisfile.h])
AC_LANG_PUSH(C++)
Modified: branches/1.8/formats/format_ogg_vorbis.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/formats/format_ogg_vorbis.c?view=diff&rev=355608&r1=355607&r2=355608
==============================================================================
--- branches/1.8/formats/format_ogg_vorbis.c (original)
+++ branches/1.8/formats/format_ogg_vorbis.c Thu Feb 16 13:26:16 2012
@@ -79,6 +79,27 @@
/*! \brief Indicates whether an End of Stream condition has been detected. */
int eos;
};
+
+#if !defined(HAVE_VORBIS_OPEN_CALLBACKS)
+/*
+ * Declared for backward compatibility with vorbisfile v1.1.2.
+ * Code taken from vorbisfile.h v1.2.0.
+ */
+static int _ov_header_fseek_wrap(FILE *f, ogg_int64_t off, int whence)
+{
+ if (f == NULL) {
+ return -1;
+ }
+ return fseek(f, off, whence);
+}
+
+static ov_callbacks OV_CALLBACKS_NOCLOSE = {
+ (size_t (*)(void *, size_t, size_t, void *)) fread,
+ (int (*)(void *, ogg_int64_t, int)) _ov_header_fseek_wrap,
+ (int (*)(void *)) NULL,
+ (long (*)(void *)) ftell
+};
+#endif /* !defined(HAVE_VORBIS_OPEN_CALLBACKS) */
/*!
* \brief Create a new OGG/Vorbis filestream and set it up for reading.
Modified: branches/1.8/include/asterisk/autoconfig.h.in
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/include/asterisk/autoconfig.h.in?view=diff&rev=355608&r1=355607&r2=355608
==============================================================================
--- branches/1.8/include/asterisk/autoconfig.h.in (original)
+++ branches/1.8/include/asterisk/autoconfig.h.in Thu Feb 16 13:26:16 2012
@@ -1008,6 +1008,9 @@
/* Define to 1 if you have the Vorbis library. */
#undef HAVE_VORBIS
+
+/* Define if your system has OV_CALLBACKS_NOCLOSE declared. */
+#undef HAVE_VORBIS_OPEN_CALLBACKS
/* Define if your system has the VoiceTronix API libraries. */
#undef HAVE_VPB
More information about the asterisk-commits
mailing list