[xiph-commits] r9531 - in trunk/theora: . lib
giles at svn.xiph.org
giles at svn.xiph.org
Tue Jun 28 02:58:52 PDT 2005
Author: giles
Date: 2005-06-28 02:58:47 -0700 (Tue, 28 Jun 2005)
New Revision: 9531
Modified:
trunk/theora/configure.ac
trunk/theora/lib/Makefile.am
trunk/theora/lib/toplevel.c
Log:
Invert the sense of and make optional the defines to disable floating
point and encode support. This way one gets a fully-functioning
libtheora by default in a naive build without having to specifically
enable these options.
Result of spending an hour trying to figure out why playback didn't work
with the scons build: theora_granule_time() was implementated but never
returned a useful timestamp because floats were disabled.
Modified: trunk/theora/configure.ac
===================================================================
--- trunk/theora/configure.ac 2005-06-27 21:52:06 UTC (rev 9530)
+++ trunk/theora/configure.ac 2005-06-28 09:58:47 UTC (rev 9531)
@@ -159,12 +159,11 @@
[ --disable-float disable use of floating point code ],
[ ac_enable_float=$enableval ], [ ac_enable_float=yes] )
-if test "x${ac_enable_float}" = xyes ; then
- AC_DEFINE(THEORA_SUPPORT_FLOAT, [1], [Build floating point code])
-else
- AC_DEFINE(THEORA_SUPPORT_FLOAT, [0], [Do not build floating point code])
+if test "x${ac_enable_float}" != xyes ; then
+ AC_DEFINE([THEORA_DISABLE_FLOAT], [],
+ [Define to exclude floating point code from the build])
fi
-AM_CONDITIONAL(THEORA_SUPPORT_FLOAT, [test "x${ac_enable_float}" = "xyes"])
+AM_CONDITIONAL(THEORA_DISABLE_FLOAT, [test "x${ac_enable_float}" != xyes])
dnl Configuration option for building of encoding support.
@@ -173,17 +172,17 @@
[ --disable-encode disable encoding support ],
[ ac_enable_encode=$enableval ], [ ac_enable_encode=yes] )
-if test "x${ac_enable_encode}" = xyes ; then
+if test "x${ac_enable_encode}" != xyes ; then
+ AC_DEFINE([THEORA_DISABLE_ENCODE], [],
+ [Define to exclude encode support from the build])
+else
if test x$HAVE_VORBIS = xyes; then
BUILDABLE_EXAMPLES="$BUILDABLE_EXAMPLES encoder_example"
else
AC_MSG_NOTICE([Vorbis missing, cannot build example encoder])
fi
- AC_DEFINE(THEORA_SUPPORT_ENCODE, [1], [Build encoding support])
-else
- AC_DEFINE(THEORA_SUPPORT_ENCODE, [0], [Do not build encoding support])
fi
-AM_CONDITIONAL(THEORA_SUPPORT_ENCODE, [test "x${ac_enable_encode}" = "xyes"])
+AM_CONDITIONAL(THEORA_DISABLE_ENCODE, [test "x${ac_enable_encode}" != xyes])
dnl --------------------------------------------------
dnl Check for headers
Modified: trunk/theora/lib/Makefile.am
===================================================================
--- trunk/theora/lib/Makefile.am 2005-06-27 21:52:06 UTC (rev 9530)
+++ trunk/theora/lib/Makefile.am 2005-06-28 09:58:47 UTC (rev 9531)
@@ -2,10 +2,10 @@
lib_LTLIBRARIES = libtheora.la
-if THEORA_SUPPORT_ENCODE
+if THEORA_DISABLE_ENCODE
+encoder_sources = encoder_disabled.c
+else
encoder_sources = dct_encode.c encode.c encoder_toplevel.c
-else
-encoder_sources = encoder_disabled.c
endif
libtheora_la_SOURCES = \
Modified: trunk/theora/lib/toplevel.c
===================================================================
--- trunk/theora/lib/toplevel.c 2005-06-27 21:52:06 UTC (rev 9530)
+++ trunk/theora/lib/toplevel.c 2005-06-28 09:58:47 UTC (rev 9531)
@@ -408,7 +408,7 @@
/* returns, in seconds, absolute time of current packet in given
logical stream */
double theora_granule_time(theora_state *th,ogg_int64_t granulepos){
-#if THEORA_SUPPORT_FLOAT
+#ifndef THEORA_DISABLE_FLOAT
CP_INSTANCE *cpi=(CP_INSTANCE *)(th->internal_encode);
PB_INSTANCE *pbi=(PB_INSTANCE *)(th->internal_decode);
@@ -424,7 +424,7 @@
}
#endif
- return(-1);
+ return(-1); /* negative granulepos or float calculations disabled */
}
/* check for header flag */
More information about the commits
mailing list