[asterisk-commits] rmudgett: branch 10 r355620 - in /branches/10: ./ autoconf/ formats/ include/...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Feb 16 13:44:48 CST 2012
Author: rmudgett
Date: Thu Feb 16 13:44:44 2012
New Revision: 355620
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=355620
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
........
Merged revisions 355608 from http://svn.asterisk.org/svn/asterisk/branches/1.8
Added:
branches/10/autoconf/ast_c_declare_check.m4
- copied unchanged from r355608, branches/1.8/autoconf/ast_c_declare_check.m4
Modified:
branches/10/ (props changed)
branches/10/configure
branches/10/configure.ac
branches/10/formats/format_ogg_vorbis.c
branches/10/include/asterisk/autoconfig.h.in
Propchange: branches/10/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.
Modified: branches/10/configure.ac
URL: http://svnview.digium.com/svn/asterisk/branches/10/configure.ac?view=diff&rev=355620&r1=355619&r2=355620
==============================================================================
--- branches/10/configure.ac (original)
+++ branches/10/configure.ac Thu Feb 16 13:44:44 2012
@@ -2112,6 +2112,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/10/formats/format_ogg_vorbis.c
URL: http://svnview.digium.com/svn/asterisk/branches/10/formats/format_ogg_vorbis.c?view=diff&rev=355620&r1=355619&r2=355620
==============================================================================
--- branches/10/formats/format_ogg_vorbis.c (original)
+++ branches/10/formats/format_ogg_vorbis.c Thu Feb 16 13:44:44 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/10/include/asterisk/autoconfig.h.in
URL: http://svnview.digium.com/svn/asterisk/branches/10/include/asterisk/autoconfig.h.in?view=diff&rev=355620&r1=355619&r2=355620
==============================================================================
--- branches/10/include/asterisk/autoconfig.h.in (original)
+++ branches/10/include/asterisk/autoconfig.h.in Thu Feb 16 13:44:44 2012
@@ -1022,6 +1022,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