[svn-commits] rmudgett: trunk r355621 - in /trunk: ./ autoconf/ formats/ include/asterisk/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Feb 16 13:51:19 CST 2012


Author: rmudgett
Date: Thu Feb 16 13:51:15 2012
New Revision: 355621

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=355621
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
........

Merged revisions 355620 from http://svn.asterisk.org/svn/asterisk/branches/10

Added:
    trunk/autoconf/ast_c_declare_check.m4
      - copied unchanged from r355620, branches/10/autoconf/ast_c_declare_check.m4
Modified:
    trunk/   (props changed)
    trunk/configure
    trunk/configure.ac
    trunk/formats/format_ogg_vorbis.c
    trunk/include/asterisk/autoconfig.h.in

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-10-merged' - no diff available.

Modified: trunk/configure.ac
URL: http://svnview.digium.com/svn/asterisk/trunk/configure.ac?view=diff&rev=355621&r1=355620&r2=355621
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Thu Feb 16 13:51:15 2012
@@ -2099,6 +2099,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: trunk/formats/format_ogg_vorbis.c
URL: http://svnview.digium.com/svn/asterisk/trunk/formats/format_ogg_vorbis.c?view=diff&rev=355621&r1=355620&r2=355621
==============================================================================
--- trunk/formats/format_ogg_vorbis.c (original)
+++ trunk/formats/format_ogg_vorbis.c Thu Feb 16 13:51:15 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: trunk/include/asterisk/autoconfig.h.in
URL: http://svnview.digium.com/svn/asterisk/trunk/include/asterisk/autoconfig.h.in?view=diff&rev=355621&r1=355620&r2=355621
==============================================================================
--- trunk/include/asterisk/autoconfig.h.in (original)
+++ trunk/include/asterisk/autoconfig.h.in Thu Feb 16 13:51:15 2012
@@ -836,19 +836,19 @@
 /* Define to 1 if you have the `strtoq' function. */
 #undef HAVE_STRTOQ
 
-/* Define to 1 if `ifr_ifru.ifru_hwaddr' is a member of `struct ifreq'. */
+/* Define to 1 if `ifr_ifru.ifru_hwaddr' is member of `struct ifreq'. */
 #undef HAVE_STRUCT_IFREQ_IFR_IFRU_IFRU_HWADDR
 
-/* Define to 1 if `uid' is a member of `struct sockpeercred'. */
+/* Define to 1 if `uid' is member of `struct sockpeercred'. */
 #undef HAVE_STRUCT_SOCKPEERCRED_UID
 
-/* Define to 1 if `st_blksize' is a member of `struct stat'. */
+/* Define to 1 if `st_blksize' is member of `struct stat'. */
 #undef HAVE_STRUCT_STAT_ST_BLKSIZE
 
-/* Define to 1 if `cr_uid' is a member of `struct ucred'. */
+/* Define to 1 if `cr_uid' is member of `struct ucred'. */
 #undef HAVE_STRUCT_UCRED_CR_UID
 
-/* Define to 1 if `uid' is a member of `struct ucred'. */
+/* Define to 1 if `uid' is member of `struct ucred'. */
 #undef HAVE_STRUCT_UCRED_UID
 
 /* Define to 1 if you have the mISDN Supplemental Services library. */
@@ -1023,6 +1023,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
 
@@ -1125,9 +1128,6 @@
 
 /* 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




More information about the svn-commits mailing list