summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2007-09-18 10:38:07 +0000
committerPierre Ossman <ossman@cendio.se>2007-09-18 10:38:07 +0000
commit03d98639808805d13dbe8915f30dd935d1a11991 (patch)
tree059993af1fa2512a381440aa6e34c48156d2fc9b
parent31dfb317fa0693ad41172befe2360f346d5b9093 (diff)
Emulate lrintf with simple truncation if it isn't available.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1851 fefdeb5f-60dc-0310-8127-8f9354f1896f
-rw-r--r--configure.ac3
-rw-r--r--src/pulsecore/ffmpeg/resample2.c7
2 files changed, 10 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 5b6c6474..5250804b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -266,6 +266,9 @@ AC_CHECK_FUNCS([getopt_long], [], [AC_CHECK_LIB([iberty], [getopt_long])])
#### Check for functions ####
+# ISO
+AC_CHECK_FUNCS([lrintf])
+
# POSIX
AC_FUNC_FORK
AC_FUNC_GETGROUPS
diff --git a/src/pulsecore/ffmpeg/resample2.c b/src/pulsecore/ffmpeg/resample2.c
index da1443d9..dfbd5287 100644
--- a/src/pulsecore/ffmpeg/resample2.c
+++ b/src/pulsecore/ffmpeg/resample2.c
@@ -86,6 +86,13 @@ static double bessel(double x){
return v;
}
+/*
+ * crude lrintf for non-C99 systems.
+ */
+#ifndef HAVE_LFRINTF
+#define lrintf(x) ((long int)(x))
+#endif
+
/**
* builds a polyphase filterbank.
* @param factor resampling factor