changeset 53:02a11507d65b

Fixed audio.seek bug in Ogg Tremor decoder interface. Unlike Ogg Vorbis, Tremor uses integer milliseconds instead of double seconds.
author Eric Wing <ewing@anscamobile.com>
date Wed, 18 Jan 2012 12:22:18 -0800
parents 53ee4253c925
children 8b4f80233969
files Isolated/LGPL/oggtremor.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Isolated/LGPL/oggtremor.c	Wed Jan 18 12:20:54 2012 -0800
+++ b/Isolated/LGPL/oggtremor.c	Wed Jan 18 12:22:18 2012 -0800
@@ -367,8 +367,8 @@
 {
     Sound_SampleInternal *internal = (Sound_SampleInternal *) sample->opaque;
     OggVorbis_File *vf = (OggVorbis_File *) internal->decoder_private;
-    double timepos = (((double) ms) / 1000.0);
-    BAIL_IF_MACRO(ov_time_seek(vf, timepos) < 0, ERR_IO_ERROR, 0);
+	/* Unlike Vorbis, Tremor uses integer milliseconds instead of double seconds. */
+    BAIL_IF_MACRO(ov_time_seek(vf, (ogg_int64_t)ms) < 0, ERR_IO_ERROR, 0);
     return(1);
 } /* OGG_seek */