decoder_example non-stereo decode fix
authorMonty <xiphmont@xiph.org>
Sun, 27 May 2001 20:33:19 +0000 (20:33 +0000)
committerMonty <xiphmont@xiph.org>
Sun, 27 May 2001 20:33:19 +0000 (20:33 +0000)
better autoconf sensing of float-version math lib funcs

Monty

svn path=/trunk/vorbis/; revision=1463

configure.in
examples/decoder_example.c
lib/os.h

index 8ba2d41..f4b0560 100644 (file)
@@ -168,6 +168,15 @@ dnl --------------------------------------------------
 AC_FUNC_ALLOCA
 AC_FUNC_MEMCMP
 
+AC_CHECK_FUNCS(sqrtf)
+AC_CHECK_FUNCS(logf)
+AC_CHECK_FUNCS(expf)
+AC_CHECK_FUNCS(powf)
+AC_CHECK_FUNCS(acosf)
+AC_CHECK_FUNCS(atanf)
+AC_CHECK_FUNCS(frexpf)
+AC_CHECK_FUNCS(rintf)
+
 dnl --------------------------------------------------
 dnl Do substitutions
 dnl --------------------------------------------------
index 735da5b..2eba003 100644 (file)
@@ -11,7 +11,7 @@
  ********************************************************************
 
  function: simple example decoder
- last mod: $Id: decoder_example.c,v 1.19 2001/03/26 23:27:42 xiphmont Exp $
+ last mod: $Id: decoder_example.c,v 1.20 2001/05/27 20:33:18 xiphmont Exp $
 
  ********************************************************************/
 
@@ -253,7 +253,7 @@ int main(int argc, char **argv){
                      clipflag=1;
                    }
                    *ptr=val;
-                   ptr+=2;
+                   ptr+=vi.channels;
                  }
                }
                
index 3ca97f2..1f1a8ef 100644 (file)
--- a/lib/os.h
+++ b/lib/os.h
@@ -9,11 +9,11 @@
  *                                                                  *
  * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001             *
  * by the XIPHOPHORUS Company http://www.xiph.org/                  *
-
+ *                                                                  *
  ********************************************************************
 
  function: #ifdef jail to whip a few platforms into the UNIX ideal.
- last mod: $Id: os.h,v 1.24 2001/02/26 03:50:42 xiphmont Exp $
+ last mod: $Id: os.h,v 1.25 2001/05/27 20:33:19 xiphmont Exp $
 
  ********************************************************************/
 
 #  define NO_FLOAT_MATH_LIB
 #endif
 
-#ifndef NO_FLOAT_MATH_LIB
+#ifdef HAVE_SQRTF
 #  define sqrt sqrtf
+#endif
+#ifdef HAVE_LOGF
 #  define log logf
+#endif
+#ifdef HAVE_EXPF
 #  define exp expf
+#endif
+#ifdef HAVE_POWF
 #  define pow powf
+#endif
+#ifdef HAVE_ACOSF
 #  define acos acosf
+#endif
+#ifdef HAVE_ATANF
 #  define atan atanf
+#endif
+#ifdef HAVE_FREXPF
 #  define frexp frexpf
+#endif
+#ifdef HAVE_RINTF
 #  define rint rintf
 #endif
 
-
 #ifndef FAST_HYPOT
 #  define FAST_HYPOT hypot
 #endif