From f7819c3cf6ac78004e5e639eeed6eb2831541103 Mon Sep 17 00:00:00 2001 From: ghaushe Date: Mon, 27 Jan 2003 20:23:15 +0000 Subject: [PATCH] * this should fix the slider length to be correct for all samples git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@589 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/sc2code/libs/sound/mixsdl/decoders/decoder.c | 4 ++-- sc2/src/sc2code/libs/sound/openal/decoders/decoder.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sc2/src/sc2code/libs/sound/mixsdl/decoders/decoder.c b/sc2/src/sc2code/libs/sound/mixsdl/decoders/decoder.c index 1dc21779c..418e3f9ef 100644 --- a/sc2/src/sc2code/libs/sound/mixsdl/decoders/decoder.c +++ b/sc2/src/sc2code/libs/sound/mixsdl/decoders/decoder.c @@ -280,11 +280,11 @@ TFB_SoundDecoder* SoundDecoder_Load (char *filename, uint32 buffer_size, decoder->frequency = vinfo->rate; decoder->looping = false; decoder->error = SOUNDDECODER_OK; - decoder->length = (float) ov_time_total (vf, -1); + decoder->length = (float) ov_time_total (vf, -1) - (startTime / 1000.0f); if (runTime && runTime / 1000.0 < decoder->length) decoder->length = (float)(runTime / 1000.0); - decoder->start_sample = decoder->frequency * startTime/1000; + decoder->start_sample = decoder->frequency * startTime / 1000; decoder->end_sample = decoder->start_sample + (unsigned long)(decoder->length * decoder->frequency); if (decoder->start_sample) diff --git a/sc2/src/sc2code/libs/sound/openal/decoders/decoder.c b/sc2/src/sc2code/libs/sound/openal/decoders/decoder.c index cd4cf72db..a35262321 100644 --- a/sc2/src/sc2code/libs/sound/openal/decoders/decoder.c +++ b/sc2/src/sc2code/libs/sound/openal/decoders/decoder.c @@ -248,11 +248,11 @@ TFB_SoundDecoder* SoundDecoder_Load (char *filename, ALuint buffer_size, unsigne decoder->frequency = vinfo->rate; decoder->looping = AL_FALSE; decoder->error = SOUNDDECODER_OK; - decoder->length = (float) ov_time_total (vf, -1); + decoder->length = (float) ov_time_total (vf, -1) - (startTime / 1000.0f); if (runTime && runTime / 1000.0 < decoder->length) decoder->length = (float)(runTime / 1000.0); - decoder->start_sample = decoder->frequency * startTime/1000; + decoder->start_sample = decoder->frequency * startTime / 1000; decoder->end_sample = decoder->start_sample + (unsigned long)(decoder->length * decoder->frequency); if (decoder->start_sample)