# HG changeset patch # User Eric Wing # Date 1351208058 25200 # Node ID 8faf61a640f0074e1e7d73e52668d4d3bf346988 # Parent 1c8414cd58394565f9af66652d91547e0ac0a6bd Resynced fixes for unit conversion bugs in the Ogg Tremor decoder from SoundDecoder/ALmixer. Ogg Vorbis uses seconds and we multiply by 1000 to convert to milliseconds. But Ogg Tremor already uses milliseconds but I was still multiplying by 1000. diff -r 1c8414cd5839 -r 8faf61a640f0 decoders/oggtremor.c --- a/decoders/oggtremor.c Wed Apr 27 19:37:16 2011 -0700 +++ b/decoders/oggtremor.c Thu Oct 25 16:34:18 2012 -0700 @@ -215,7 +215,7 @@ if (OV_EINVAL == total_time) internal->total_time = -1; else - internal->total_time = (Sint32)(total_time * 1000.0 + 0.5); + internal->total_time = (Sint32)(total_time); /* @@ -365,8 +365,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 */