aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputPlugins/ogg_plugin.c
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2005-08-25 08:07:28 +0000
committerEric Wong <normalperson@yhbt.net>2005-08-25 08:07:28 +0000
commit1a3254f73ca3527388854d6af8e2b5e06e5c13e0 (patch)
treed0aa17b231a6754433cb53ba5aa32d4fd14c2091 /src/inputPlugins/ogg_plugin.c
parent65ec1dc3208885f09706b7059c3d4eb2955a566c (diff)
downloadmpd-1a3254f73ca3527388854d6af8e2b5e06e5c13e0.tar.gz
mpd-1a3254f73ca3527388854d6af8e2b5e06e5c13e0.tar.xz
mpd-1a3254f73ca3527388854d6af8e2b5e06e5c13e0.zip
patch for using Tremor to decode Ogg-Vorbis
* autotools support is included, the floating point Vorbis decoder remains the default. * close bug #353 * Thanks to Hannes Reich for the patch git-svn-id: https://svn.musicpd.org/mpd/trunk@3453 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/inputPlugins/ogg_plugin.c')
-rw-r--r--src/inputPlugins/ogg_plugin.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/inputPlugins/ogg_plugin.c b/src/inputPlugins/ogg_plugin.c
index 137c4176c..f74e3e56a 100644
--- a/src/inputPlugins/ogg_plugin.c
+++ b/src/inputPlugins/ogg_plugin.c
@@ -32,7 +32,22 @@
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
+
+#ifndef HAVE_TREMOR
#include <vorbis/vorbisfile.h>
+#else
+#include <tremor/ivorbisfile.h>
+/* Macros to make Tremor's API look like libogg. Tremor always
+ returns host-byte-order 16-bit signed data, and uses integer
+ milliseconds where libogg uses double seconds.
+*/
+#define ov_read(VF, BUFFER, LENGTH, BIGENDIANP, WORD, SGNED, BITSTREAM) \
+ ov_read(VF, BUFFER, LENGTH, BITSTREAM)
+#define ov_time_total(VF, I) ((double)ov_time_total(VF, I)/1000)
+#define ov_time_tell(VF) ((double)ov_time_tell(VF)/1000)
+#define ov_time_seek_page(VF, S) (ov_time_seek_page(VF, (S)*1000))
+#endif /* HAVE_TREMOR */
+
#include <errno.h>
#ifdef WORDS_BIGENDIAN