From 49a3707dd32e557a393916ef8a620ade5f778ccc Mon Sep 17 00:00:00 2001 From: meep-eep Date: Tue, 1 Nov 2005 13:00:09 +0000 Subject: [PATCH] Fix comm slider when using Tremor (bug #785). git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1941 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/sc2code/libs/sound/decoders/oggaud.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sc2/src/sc2code/libs/sound/decoders/oggaud.c b/sc2/src/sc2code/libs/sound/decoders/oggaud.c index f669990a8..07a8162c0 100644 --- a/sc2/src/sc2code/libs/sound/decoders/oggaud.c +++ b/sc2/src/sc2code/libs/sound/decoders/oggaud.c @@ -199,8 +199,14 @@ ova_Open (THIS_PTR, uio_DirHandle *dir, const char *filename) } This->frequency = vinfo->rate; +#ifdef OVCODEC_TREMOR + // With tremor ov_time_total returns an integer, in milliseconds. + This->length = ((float) ov_time_total (&ova->vf, -1)) / 1000.0f; +#else + // With libvorbis ov_time_total returns a double, in seconds. This->length = (float) ov_time_total (&ova->vf, -1); - +#endif /* OVCODEC_TREMOR */ + if (vinfo->channels == 1) This->format = ova_formats->mono16; else